Skip to content

bug(#46): header 값 요청 변경#59

Merged
fixgramwork merged 1 commit intodevelopfrom
46-과제-s3-자료-저장-기능
Aug 31, 2025

Hidden character warning

The head ref may contain hidden characters: "46-\uacfc\uc81c-s3-\uc790\ub8cc-\uc800\uc7a5-\uae30\ub2a5"
Merged

bug(#46): header 값 요청 변경#59
fixgramwork merged 1 commit intodevelopfrom
46-과제-s3-자료-저장-기능

Conversation

@fixgramwork
Copy link
Member

@fixgramwork fixgramwork commented Aug 31, 2025

header 공통 반환

Summary by CodeRabbit

  • 버그 수정
    • 첨부파일 다운로드 시 콘텐츠 타입을 실제 파일 유형에 맞춰 동적으로 설정하여 브라우저 미리보기/열기 동작을 개선했습니다.
    • 파일 이름을 UTF-8로 안전하게 인코딩해 한글·특수문자 등이 깨지지 않고 올바르게 표시되도록 했습니다.
    • 표준 Content-Disposition 헤더 적용으로 일부 브라우저에서 발생하던 파일명 표시 오류 및 다운로드 호환성 문제를 해결했습니다.

@coderabbitai
Copy link

coderabbitai bot commented Aug 31, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

SubmissionCommandController의 첨부파일 다운로드 로직을 업데이트하여, 저장된 원본 파일명과 콘텐츠 타입을 기반으로 응답의 Content-Type을 동적으로 설정하고, Content-Disposition 헤더를 ContentDisposition 빌더로 구성하도록 변경했습니다. 기타 메소드 흐름은 유지되었습니다.

Changes

Cohort / File(s) Summary
Submission attachment download headers and media type
src/main/java/hello/cluebackend/domain/submission/api/SubmissionCommandController.java
- ContentDisposition, StandardCharsets import 추가
- 원본 파일명/콘텐츠 타입을 SubmissionAttachment에서 조회
- 응답 Content-Type을 동적으로 MediaType으로 설정(없으면 MediaType.ALL)
- 헤더 문자열 결합 방식 제거, ContentDisposition.attachment().filename(..., UTF_8) 사용

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Client
  participant Ctl as SubmissionCommandController
  participant S as Storage/Repository

  C->>Ctl: GET /submissions/{id}/attachments/{attachmentId}/download
  Ctl->>S: Find SubmissionAttachment(attachmentId)
  S-->>Ctl: Attachment(meta: filename, contentType), Resource

  note over Ctl: Determine mediaType = contentType or ALL<br/>Build Content-Disposition via ContentDisposition

  Ctl-->>C: 200 OK<br/>Headers: Content-Type, Content-Disposition<br/>Body: file stream
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • bug(#46): MediaType 수정 #57: 동일 컨트롤러의 첨부 다운로드에서 MediaType 기본값을 MediaType.ALL로 설정하는 변경과 겹치며, 본 PR은 추가로 ContentDisposition 사용으로 헤더 구성 방식을 교체합니다.

Poem

귀 쫑긋, 코드에 살짝 킁킁-
파일 이름, 타입도 정갈히 챙겼지!
헤더는 척척, 표준으로 딱-
토끼는 꼬리 살랑, 바이트는 착착-
다운로드 바스락, 밤하늘 별도 박수짝! 🐇📦✨


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between fd58867 and 173a69b.

📒 Files selected for processing (1)
  • src/main/java/hello/cluebackend/domain/submission/api/SubmissionCommandController.java (3 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 46-과제-s3-자료-저장-기능

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@fixgramwork fixgramwork merged commit dc17b2b into develop Aug 31, 2025
1 of 2 checks passed
@fixgramwork fixgramwork deleted the 46-과제-s3-자료-저장-기능 branch September 4, 2025 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant