-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Improvment] improve resource service response #15997
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, please fix the CI error
6fa3678
to
c5b1dbc
Compare
*/ | ||
Result<Object> verifyResourceName(String fullName, ResourceType type, User loginUser); | ||
void verifyResourceName(String fullName, ResourceType type, User loginUser); |
Check notice
Code scanning / CodeQL
Useless parameter Note
void createDirectory(User loginUser, | ||
String name, | ||
ResourceType type, | ||
int pid, |
Check notice
Code scanning / CodeQL
Useless parameter Note
} | ||
if (FileUtils.directoryTraversal(Objects.requireNonNull(file.getOriginalFilename()))) { | ||
log.warn("File original name verify failed, fileOriginalName:{}.", | ||
RegexUtils.escapeNRT(file.getOriginalFilename())); |
Check failure
Code scanning / CodeQL
Log Injection High
user-provided value
if (!fileSuffix.equalsIgnoreCase(nameSuffix)) { | ||
// rename file suffix and original suffix must be consistent | ||
log.warn("Rename file suffix and original suffix must be consistent, fileOriginalName:{}.", | ||
RegexUtils.escapeNRT(file.getOriginalFilename())); |
Check failure
Code scanning / CodeQL
Log Injection High
user-provided value
log.warn( | ||
"Resource file size is larger than max file size, fileOriginalName:{}, fileSize:{}, maxFileSize:{}.", | ||
RegexUtils.escapeNRT(file.getOriginalFilename()), file.getSize(), Constants.MAX_FILE_SIZE); |
Check failure
Code scanning / CodeQL
Log Injection High
user-provided value
f25254c
to
3dea6db
Compare
Purpose of the pull request
Improve resource service response, avoid to use
Result<Object>
Brief change log
ResourceService
andResourceServiceImpl
Verify this pull request
update the UT
ResourcesServiceTest