spring security 파일 다운로드 설정 추가

This commit is contained in:
2026-01-19 20:22:41 +09:00
parent 9e7ed0e53f
commit 9dcc4dcf98
3 changed files with 7 additions and 2 deletions

View File

@@ -125,6 +125,7 @@ public class SecurityConfig {
config.setAllowedMethods(List.of("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"));
config.setAllowedHeaders(List.of("*")); // 헤더요청 Authorization, Content-Type, X-Custom-Header
config.setAllowCredentials(true); // 쿠키, Authorization 헤더, Bearer Token 등 자격증명 포함 요청을 허용할지 설정
config.setExposedHeaders(List.of("Content-Disposition"));
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
/** "/**" → 모든 API 경로에 대해 이 CORS 규칙을 적용 /api/** 같이 특정 경로만 지정 가능. */