Skip to content

Commit

Permalink
[Fix] cors 에러 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
yj-leez committed Dec 21, 2023
1 parent 4a3ada5 commit 99b7db1
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,16 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
@Bean
public CorsConfigurationSource corsConfigurationSource() {
CorsConfiguration configuration = new CorsConfiguration();
configuration.addAllowedOrigin("http://localhost:3000");
configuration.addAllowedOrigin("https://react-vote-18th.vercel.app/");
configuration.addAllowedOrigin("https://react-vote-18th.vercel.app");
configuration.addAllowedOrigin("http://52.79.115.164:8080");
// configuration.addAllowedOrigin("http://localhost:3000");
// configuration.addAllowedOrigin("https://react-vote-18th.vercel.app/");
// configuration.addAllowedOrigin("https://react-vote-18th.vercel.app");
// configuration.addAllowedOrigin("http://52.79.115.164:8080");
// configuration.setAllowCredentials(true);
configuration.addAllowedOrigin("*");
configuration.addAllowedOriginPattern("*");
configuration.addAllowedMethod("*");
configuration.addAllowedHeader("*");
configuration.setAllowCredentials(true);
configuration.addExposedHeader("*");
configuration.setMaxAge(Duration.ofSeconds(3600));
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", configuration);
Expand Down

0 comments on commit 99b7db1

Please sign in to comment.