Skip to content

Commit

Permalink
[Refactor] CORS설정
Browse files Browse the repository at this point in the history
  • Loading branch information
hen715 committed Jan 30, 2024
1 parent 05aface commit 288a07d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.springframework.web.cors.CorsConfigurationSource;

import java.util.Collections;
import java.util.List;

@EnableWebSecurity
@Configuration
Expand All @@ -39,8 +40,9 @@ public CorsConfiguration getCorsConfiguration(HttpServletRequest request) {
CorsConfiguration configuration = new CorsConfiguration();
configuration.setAllowCredentials(true);
configuration.addAllowedHeader("*");
configuration.setExposedHeaders(Collections.singletonList("*"));
configuration.setAllowedOrigins(Collections.singletonList("*"));
configuration.setAllowedMethods(Collections.singletonList("*"));
configuration.setAllowedMethods(List.of("GET","POST","DELETE","PUT"));
configuration.setMaxAge(3600L);
return configuration;
}
Expand Down

0 comments on commit 288a07d

Please sign in to comment.