Skip to content

fix(web,admin): 이미지 URL을 upload CDN으로 통일#510

Merged
manNomi merged 1 commit intomainfrom
codex/cdn-upload-unify-main-clean
May 3, 2026
Merged

fix(web,admin): 이미지 URL을 upload CDN으로 통일#510
manNomi merged 1 commit intomainfrom
codex/cdn-upload-unify-main-clean

Conversation

@manNomi
Copy link
Copy Markdown
Contributor

@manNomi manNomi commented May 3, 2026

요약

  • web/admin 이미지 URL 정규화 기준을 cdn.upload.solid-connection.com으로 통일했습니다.
  • 로컬 정적 경로(/images, /svgs), blob:, data:, 외부 도메인 URL은 그대로 유지합니다.
  • FallbackImagecdnHostType 인터페이스는 호환성을 유지하고, default는 내부적으로 upload alias로 동작합니다.

변경 사항

  • web 공통 유틸 추가: apps/web/src/utils/cdnUrl.ts
  • convertUploadedImageUrl / convertImageUrl를 공통 정규화 로직으로 통합
  • FallbackImage가 원격 URL 및 상대 key를 upload CDN 기준으로 해석하도록 변경
  • admin 공통 유틸 추가: apps/admin/src/lib/utils/cdnUrl.ts
  • GPA/어학 점수 테이블에서 프로필 이미지 src와 인증파일 링크를 정규화 로직으로 통일

URL 정규화 규칙

  • upload CDN으로 변환:
    • https://cdn.default.solid-connection.com/...
    • https://solid-connection.s3.ap-northeast-2.amazonaws.com/...
    • https://s3.ap-northeast-2.amazonaws.com/solid-connection/...
    • foo/bar.png 같은 상대 key
  • 그대로 유지:
    • /images/..., /svgs/...
    • blob:*, data:*
    • 외부 호스트 URL(카카오/지도 등)

검증

  • pnpm --filter web run lint:check
  • pnpm --filter web run typecheck:ci
  • pnpm --filter admin run lint:check
  • pnpm --filter admin run typecheck:ci
  • tsx 기반 URL 변환 케이스 확인

@manNomi manNomi requested review from enunsnv and wibaek as code owners May 3, 2026 14:25
@vercel
Copy link
Copy Markdown

vercel Bot commented May 3, 2026

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

Project Deployment Actions Updated (UTC)
solid-connect-web-admin Building Building Preview, Comment May 3, 2026 2:25pm
solid-connection-web Building Building Preview, Comment May 3, 2026 2:25pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 3, 2026

Warning

Rate limit exceeded

@manNomi has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 53 minutes and 18 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 49baa1d4-9818-4e4b-bb5d-84ef7eb6dd9c

📥 Commits

Reviewing files that changed from the base of the PR and between dd5e207 and ea99d6d.

📒 Files selected for processing (6)
  • apps/admin/src/components/features/scores/GpaScoreTable.tsx
  • apps/admin/src/components/features/scores/LanguageScoreTable.tsx
  • apps/admin/src/lib/utils/cdnUrl.ts
  • apps/web/src/components/ui/FallbackImage.tsx
  • apps/web/src/utils/cdnUrl.ts
  • apps/web/src/utils/fileUtils.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/cdn-upload-unify-main-clean

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
Review rate limit: 0/1 reviews remaining, refill in 53 minutes and 18 seconds.

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

@manNomi manNomi changed the title fix(web,admin): unify image URLs to upload CDN fix(web,admin): 이미지 URL을 upload CDN으로 통일 May 3, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ea99d6df8f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

if (trimmedSrc.startsWith("//")) return `https:${trimmedSrc}`;
if (!cdnHostType) return trimmedSrc;
if (trimmedSrc.startsWith("//")) return normalizeImageUrlToUploadCdn(`https:${trimmedSrc}`);
if (trimmedSrc.startsWith("/")) return trimmedSrc;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve CDN host mapping for slash-prefixed image keys

resolveCdnUrl now returns any "/..." source immediately, which bypasses cdnHostType host resolution. For call sites like ProfileWithBadge that pass cdnHostType="upload", slash-prefixed API keys (for example /profile/abc.png) are now requested from the web origin instead of the CDN and will 404/fall back. This is a behavioral regression from the previous implementation, which normalized both prefixed and unprefixed relative keys onto the CDN host.

Useful? React with 👍 / 👎.

Comment on lines +72 to +73
if (trimmed.startsWith("blob:") || trimmed.startsWith("data:") || trimmed.startsWith("/")) {
return trimmed;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Convert slash-prefixed report paths to upload CDN

The admin URL normalizer treats any value starting with / as already-resolved and returns it unchanged. After this commit, GPA/language report links use this helper, so slash-prefixed report keys (for example /scores/report.pdf) now open against the admin app origin instead of the CDN object URL. Previously these links were explicitly prefixed with VITE_S3_BASE_URL, so this change can break report downloads for relative-path data.

Useful? React with 👍 / 👎.

@manNomi manNomi merged commit 49ba3d3 into main May 3, 2026
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant