Open
Conversation
abcb-s
reviewed
Apr 17, 2026
L98293
reviewed
Apr 17, 2026
abcb-s
reviewed
Apr 22, 2026
L98293
reviewed
Apr 24, 2026
Comment on lines
+22
to
+24
| public BaseResponse<ImageUploadResponse> uploadImage( | ||
|
|
||
| @ModelAttribute @Valid final ImageUploadRequest imageUploadRequest) { |
Contributor
There was a problem hiding this comment.
public BaseResponse uploadImage(@ModelAttribute @Valid final ImageUploadRequest imageUploadRequest) {
이렇게 줄바꿈 제거 해주시길 바랍니다.
Comment on lines
+9
to
+11
| public static FileUploadResponse of( | ||
| String file_url, | ||
| String message) { |
Contributor
|
|
||
| String message | ||
| ) { | ||
| public static FileUploadResponse of( |
| @Getter | ||
| @RequiredArgsConstructor | ||
| public enum FileStatusCode implements StatusCode { | ||
| FILE_EMPTY("FILE_EMPTY", "업로드할 파일이 비어 있습니다.", HttpStatus.BAD_REQUEST), |
| MultipartFile multipartFile = fileUploadRequest.multipartFile(); | ||
|
|
||
| if (multipartFile == null || multipartFile.isEmpty()) { | ||
| throw new ApplicationException(FileStatusCode.FILE_EMPTY); |
| } | ||
|
|
||
| try { | ||
| Path uploadPath = Path.of(fileDirectory).toAbsolutePath().normalize(); |
| String storedFileName = UUID.randomUUID() + "_" + originalFilename; | ||
| Path targetPath = uploadPath.resolve(storedFileName); | ||
|
|
||
| Files.copy(multipartFile.getInputStream(), targetPath, StandardCopyOption.REPLACE_EXISTING); |
Contributor
There was a problem hiding this comment.
해당 부분은 파일 경로에 대한 검증이 없으며, 악성 스크립트 파일이 업로드 될 수 있는 심각한 보안 취약점이 발생할 수 있으니 빠른 수정 바랍니다.
| } | ||
|
|
||
| try { | ||
| Path uploadPath = Path.of(imageDirectory).toAbsolutePath().normalize(); |
| private static final List<String> ALLOWED_CONTENT_TYPES = List.of( | ||
| "image/jpeg", | ||
| "image/png", | ||
| "image/gif", |
Comment on lines
+70
to
+71
| "/files/*", | ||
| "/images/*", |
Contributor
There was a problem hiding this comment.
이 두개는 Swagger관련이 아니므로 따로 빼 주시길 바랍니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
작업내용
관련 이슈
#16
Jira 기능 링크(선택)
https://team-23d.atlassian.net/browse/KAN-33
확인사항