diff --git a/src/main/java/com/chwipoClova/common/config/CorsConfig.java b/src/main/java/com/chwipoClova/common/config/CorsConfig.java index 93ec35a..3fd4256 100644 --- a/src/main/java/com/chwipoClova/common/config/CorsConfig.java +++ b/src/main/java/com/chwipoClova/common/config/CorsConfig.java @@ -1,8 +1,10 @@ package com.chwipoClova.common.config; +import com.chwipoClova.common.utils.JwtUtil; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.http.HttpHeaders; import org.springframework.web.cors.CorsConfiguration; import org.springframework.web.cors.CorsConfigurationSource; import org.springframework.web.cors.UrlBasedCorsConfigurationSource; @@ -24,7 +26,7 @@ public CorsConfigurationSource corsConfigurationSource() { config.setAllowedMethods(List.of("GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS")); config.setAllowedHeaders(List.of("*")); - config.setExposedHeaders(List.of("*")); + config.setExposedHeaders(List.of("cache-control", "content-length", "content-type", "expires", "pragma", HttpHeaders.SET_COOKIE, JwtUtil.ACCESS_TOKEN)); UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); source.registerCorsConfiguration("/**", config);