-
Notifications
You must be signed in to change notification settings - Fork 0
[FEAT] 이미지 경로 제거 기능 구현 #45
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
Changes from all commits
0793997
aa786dd
4f0a3bc
d8824e5
8d76a18
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -52,7 +52,8 @@ public ImageFile uploadOriginal(String dir, MultipartFile file, int index) { | |||||||
| validateExtension(file.getOriginalFilename()); | ||||||||
|
|
||||||||
| String originalFilename = file.getOriginalFilename(); | ||||||||
| String key = buildKey(dir, originalFilename, index); | ||||||||
| // String key = buildKey(dir, originalFilename, index); | ||||||||
| String key = buildKey(originalFilename, index); | ||||||||
|
Comment on lines
+55
to
+56
|
||||||||
| // String key = buildKey(dir, originalFilename, index); | |
| String key = buildKey(originalFilename, index); | |
| String key = buildKey(dir, originalFilename, index); |
Copilot
AI
Dec 9, 2025
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.
The validateDir method has most of its validation logic commented out (lines 258-264), but still validates for path traversal (line 266-268) and trailing slashes (line 270-272). This creates an inconsistent state where:
- The method is still called by existing methods like
uploadAsWebpWithSizes(String dir, ...)at line 132 - But it only performs partial validation
This makes the code confusing and error-prone. Consider either:
- Removing the commented code if directory validation is no longer needed
- Or creating a separate validation method for the new root-only functionality
The commented-out validation checks are still being called by the existing dir-based methods, so they may cause unexpected behavior.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -140,22 +140,22 @@ POST http://localhost:8080/api/v1/groups/images/{{groupId}}/upload | |
| ?userId=1 | ||
| Content-Type: multipart/form-data; boundary=boundary | ||
|
|
||
| --boundary | ||
| --boundary-- | ||
|
||
| Content-Disposition: form-data; name="images"; filename="test-webp1.webp" | ||
| Content-Type: image/webp | ||
|
|
||
| < ../image/resources/test-webp1.webp | ||
| --boundary | ||
| --boundary-- | ||
|
||
| Content-Disposition: form-data; name="images"; filename="test-webp1.webp" | ||
| Content-Type: image/webp | ||
|
|
||
| < ../image/resources/test-webp1.webp | ||
| --boundary | ||
| --boundary-- | ||
|
||
| Content-Disposition: form-data; name="images"; filename="img1.png" | ||
| Content-Type: image/png | ||
|
|
||
| < ../image/resources/img1.png | ||
| --boundary | ||
| --boundary-- | ||
|
||
| Content-Disposition: form-data; name="images"; filename="img2.jpg" | ||
| Content-Type: image/jpeg | ||
|
|
||
|
|
||
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.
Commented-out code should be removed rather than left in the codebase. If this code is needed for reference, it should be documented in a TODO comment or commit message instead. The PR description mentions implementing the feature with method overloading to preserve previous functionality, so the old implementation can be recovered from git history if needed.