Skip to content

Commit

Permalink
fix: (#716) CorsFilter 기존과 동일하게 구성
Browse files Browse the repository at this point in the history
  • Loading branch information
woo-chang committed Oct 5, 2023
1 parent 4bcf178 commit 282af5a
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.springframework.boot.web.servlet.FilterRegistrationBean;
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.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
Expand All @@ -37,9 +38,13 @@ public FilterRegistrationBean<CorsFilter> corsFilterRegistrationBean() {
final CorsConfiguration config = new CorsConfiguration();
config.setAllowCredentials(true);
config.addAllowedOrigin(LOCALHOST_FRONTEND);
config.addAllowedOrigin(HTTPS_LOCALHOST_FRONTEND);
config.addAllowedOrigin(DEV_SERVER);
config.addAllowedOrigin(PROD_SERVER);
config.addAllowedHeader("*");
config.addAllowedMethod("*");
config.setMaxAge(6000L);
config.addExposedHeader(HttpHeaders.LOCATION);
config.addExposedHeader(HttpHeaders.SET_COOKIE);

final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", config);
Expand Down

0 comments on commit 282af5a

Please sign in to comment.