fix: CORS preflight 응답에 x-api-key 헤더 허용 추가

- exposed_headers에 x-api-key, Authorization 추가
- max_age를 86400초(24시간)로 설정하여 preflight 캐싱 활성화
- React 프론트엔드에서 API 호출 시 CORS 에러 해결
This commit is contained in:
2025-11-24 12:43:06 +09:00
parent 1e0433e2b3
commit 8e8ab65288

View File

@@ -6,7 +6,7 @@
'allowed_origins' => ['*'], // 모든 도메인 허용 (보안 주의)
'allowed_origins_patterns' => [],
'allowed_headers' => ['*'], // 모든 헤더 허용
'exposed_headers' => [],
'max_age' => 0,
'exposed_headers' => ['x-api-key', 'Authorization'], // 커스텀 헤더 명시
'max_age' => 86400, // Preflight 캐싱 (24시간)
'supports_credentials' => false,
];