Skip to content

Comments

[fix] 개발서버 업로드 안되는 문제 수정#1231

Merged
lepitaaar merged 1 commit intodevelop/befrom
fix/#1230-upload-failed-in-staging-MOA-675
Feb 22, 2026
Merged

[fix] 개발서버 업로드 안되는 문제 수정#1231
lepitaaar merged 1 commit intodevelop/befrom
fix/#1230-upload-failed-in-staging-MOA-675

Conversation

@lepitaaar
Copy link
Contributor

@lepitaaar lepitaaar commented Feb 22, 2026

#️⃣연관된 이슈

📝작업 내용

기존 파일경로가 대문자였다가 소문자로 변경된후 그대로 남아있는 정보때문에 검증 실패처리가되어 업로드에 실패했습니다.
해당 pr에선 이미지 경로를 검증할때 대소문자를 가리지 않게 변경하였습니다.


clubId/FEED/ -> 현 clubId/feed/
원래저장된 대문자 경로를 맞지않은 형식으로 확인함 따라서 feed, FEED 등 대소문자 구분안하게 변경

중점적으로 리뷰받고 싶은 부분(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

논의하고 싶은 부분(선택)

논의하고 싶은 부분이 있다면 작성해주세요.

🫡 참고사항

Summary by CodeRabbit

릴리스 노트

  • Bug Fixes
    • 파일 검증 로직을 개선하여 경로 확인 시 대소문자 구분을 제거했습니다. 이제 파일 유효성 검사가 더욱 안정적으로 동작합니다.

@lepitaaar lepitaaar self-assigned this Feb 22, 2026
@lepitaaar lepitaaar added 💾 BE Backend 🛠Fix 기능이 의도한 대로 동작하지 않는 버그를 수정 labels Feb 22, 2026
@vercel
Copy link

vercel bot commented Feb 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
moadong Ready Ready Preview, Comment Feb 22, 2026 3:34pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 22, 2026

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: Invalid regex pattern for base branch. Received: "**" at "reviews.auto_review.base_branches[0]"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Walkthrough

CloudflareImageServicevalidateFileConstraints 메서드에서 파일 키 접두사 검증 로직을 수정했습니다. 기존의 대소문자 구분 startsWith() 메서드를 regionMatches(true, 0, keyPrefix, 0, keyPrefix.length())를 사용한 대소문자 미구분 검증으로 변경하여 더욱 유연한 비교를 제공합니다.

Changes

Cohort / File(s) Summary
대소문자 미구분 접두사 검증
backend/src/main/java/moadong/media/service/CloudflareImageService.java
파일 키 접두사 검증을 대소문자 미구분 비교로 변경. regionMatches() 메서드를 도입하여 keyPrefix 로컬 변수를 사용하면서 동일한 에러 처리 유지.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 PR의 주요 변경 사항인 개발서버 업로드 문제 수정을 명확히 요약하고 있으며, 실제 코드 변경(대소문자 구분 없는 이미지 경로 검증)과 일치합니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/#1230-upload-failed-in-staging-MOA-675

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Member

@seongwon030 seongwon030 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

사소하지만 중요한 문제였네요 찾아내느라 수고하셨습니다

@github-actions
Copy link

Test Results

99 tests   99 ✅  19s ⏱️
23 suites   0 💤
23 files     0 ❌

Results for commit 1440e27.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
backend/src/main/java/moadong/media/service/CloudflareImageService.java (1)

254-255: 수정 방향 정확함 — 장기적으로 데이터 마이그레이션 고려

regionMatches(true, ...) 를 사용한 대소문자 무시 비교는 올바른 수정입니다. 추출된 key는 실제 S3 headObject 호출(Line 262)에 원래 케이싱 그대로 전달되므로, 검증 완화가 S3 조작에는 영향을 주지 않습니다. clubId는 인증된 세션 파라미터에서 오며 MongoDB ObjectId(hex)이므로 케이싱 차이가 보안 경계를 넘지 않습니다.

다만, 대소문자 무시 비교는 구 데이터와의 하위호환성을 위한 임시 조치입니다. 장기적으로는 기존 저장된 FEED/LOGO/COVER 경로를 소문자로 일괄 마이그레이션하면, 추후 이 검증을 단순한 startsWith로 되돌릴 수 있습니다.

🔎 참고: 마이그레이션 후 원래대로 되돌리는 코드
-        String keyPrefix = clubId + "/" + fileType.getPath() + "/";
-        if (key == null || !key.regionMatches(true, 0, keyPrefix, 0, keyPrefix.length())) {
+        String keyPrefix = clubId + "/" + fileType.getPath() + "/";
+        if (key == null || !key.startsWith(keyPrefix)) {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@backend/src/main/java/moadong/media/service/CloudflareImageService.java`
around lines 254 - 255, Change in CloudflareImageService: keep the
case-insensitive validation using key.regionMatches(true, 0, keyPrefix, 0,
keyPrefix.length()) for now but add a clear TODO comment referencing
fileType.getPath() and keyPrefix stating this is temporary for backward
compatibility; plan and document a migration that lowercases existing S3 keys
(FEED/LOGO/COVER) and then revert the check to a simple startsWith(keyPrefix).
Also ensure the original key variable continues to be passed unchanged to the
headObject call so S3 operations use the exact stored key.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@backend/src/main/java/moadong/media/service/CloudflareImageService.java`:
- Around line 254-255: Change in CloudflareImageService: keep the
case-insensitive validation using key.regionMatches(true, 0, keyPrefix, 0,
keyPrefix.length()) for now but add a clear TODO comment referencing
fileType.getPath() and keyPrefix stating this is temporary for backward
compatibility; plan and document a migration that lowercases existing S3 keys
(FEED/LOGO/COVER) and then revert the check to a simple startsWith(keyPrefix).
Also ensure the original key variable continues to be passed unchanged to the
headObject call so S3 operations use the exact stored key.

@lepitaaar lepitaaar merged commit 7e36c07 into develop/be Feb 22, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💾 BE Backend 🛠Fix 기능이 의도한 대로 동작하지 않는 버그를 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants