Skip to content

axios를 네이티브 fetch API로 마이그레이션#107

Merged
user983740 merged 6 commits into
mainfrom
refactor/migrate-axios-to-fetch
Apr 19, 2026
Merged

axios를 네이티브 fetch API로 마이그레이션#107
user983740 merged 6 commits into
mainfrom
refactor/migrate-axios-to-fetch

Conversation

@user983740

Copy link
Copy Markdown
Collaborator

Summary

  • axios 의존성을 제거하고 네이티브 fetch 기반 API 래퍼(src/shared/api/fetch.ts)로 교체
  • CRLF injection 취약점(CVE-2026-40175, CVSS 10.0) 대응 및 의존성 경량화
  • axios + transitive 23개 패키지 제거

Changes

  • src/shared/api/fetch.ts: fetch 래퍼 신규 (baseURL, Bearer 토큰 자동 주입, ApiError 클래스, isApiError 타입 가드)
  • src/shared/api/axios.ts: 삭제
  • 8개 API 파일: import 경로 변경
  • 8개 소비 파일: isAxiosErrorisApiError, error.response.statuserror.status

Test plan

  • npm run typecheck 통과
  • npm run lint 통과 (기존 warning만 존재)
  • npm run build 통과
  • 로그인/회원가입 동작 확인
  • 장바구니 추가/삭제 동작 확인
  • 수강신청 연습 시작/종료 동작 확인
  • 마이페이지 프로필 수정/비밀번호 변경 동작 확인

🤖 Generated with Claude Code

user983740 and others added 2 commits April 16, 2026 10:02
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>

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

Copy link
Copy Markdown

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: 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".

Comment thread src/shared/api/fetch.ts
};

function buildUrl(path: string, params?: Record<string, unknown>): string {
const url = new URL(path, BASE_URL);

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 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 👍 / 👎.

user983740 and others added 4 commits April 19, 2026 17:56
- 각 페이지 로고 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>
@user983740
user983740 merged commit 5f7e1f1 into main Apr 19, 2026
2 checks passed
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