axios를 네이티브 fetch API로 마이그레이션#107
Conversation
CRLF injection 취약점(CVE-2026-40175) 대응 및 의존성 경량화를 위해 axios를 제거하고 네이티브 fetch 기반 API 래퍼로 교체. - src/shared/api/fetch.ts: fetch 래퍼 (baseURL, Bearer 토큰, ApiError) - 8개 API 파일: import 경로 변경 (axios → fetch) - 8개 소비 파일: isAxiosError → isApiError, error.response.x → error.x - axios 패키지 제거 (+ transitive 23개 패키지) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f9f4155946
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| }; | ||
|
|
||
| function buildUrl(path: string, params?: Record<string, unknown>): string { | ||
| const url = new URL(path, BASE_URL); |
There was a problem hiding this comment.
Preserve Axios baseURL semantics when building request URLs
Constructing URLs with new URL(path, BASE_URL) changes behavior from Axios for all current call sites that pass leading-slash paths like /api/...: if VITE_API_URL is relative (for example / with Vite proxy), this throws TypeError: Invalid URL, and if it is absolute with a path prefix (for example https://host/backend/), the leading slash drops that prefix and requests go to https://host/api/... instead. This turns a valid configuration into broken routing for every API call in those environments.
Useful? React with 👍 / 👎.
- 각 페이지 로고 alt text "All Clear Logo" → "SnuClear Logo" - practice-session 로고 텍스트 "ALL CLEAR" → "SNUCLEAR" - Footer 노션 링크 slug AllClear → SnuClear - CLAUDE.md 프로젝트 개요 리네이밍 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- 메인 페이지 상단에 수강신청 기간 표 동적 렌더 (현재 진행중인 기간 하이라이트) - features/course-sync 모듈에 useSugangPeriodQuery 등 API/훅 추가 - 어드민 사이드바에 "수강신청 기간 동기화" 탭 추가 - SugangPeriodSyncSection: 자동 동기화 ON/OFF, 수동 실행 UI - 기간 테이블 2~4열 텍스트 중앙정렬 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ReactionTimeByAttribute 컴포넌트 (admin/index.tsx 연결은 추후) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
로컬 개발 시 vite proxy로 /api 요청 우회하도록 동일 오리진 설정. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
src/shared/api/fetch.ts)로 교체Changes
src/shared/api/fetch.ts: fetch 래퍼 신규 (baseURL, Bearer 토큰 자동 주입,ApiError클래스,isApiError타입 가드)src/shared/api/axios.ts: 삭제isAxiosError→isApiError,error.response.status→error.statusTest plan
npm run typecheck통과npm run lint통과 (기존 warning만 존재)npm run build통과🤖 Generated with Claude Code