Skip to content

Commit

Permalink
fix: cors url
Browse files Browse the repository at this point in the history
  • Loading branch information
oxdjww committed May 11, 2024
1 parent 8725606 commit f244cdc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public void addCorsMappings(CorsRegistry corsRegistry) {

corsRegistry.addMapping("/**") //모든 경로에서 매핑 진행
.exposedHeaders("Set-Cookie") //노출할 헤더값은 쿠키헤더
.allowedOrigins("http://localhost:3000"); //리액트서버주소에서 허용
.allowedOrigins("http://localhost:3000/**"); //리액트서버주소에서 허용
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {

CorsConfiguration configuration = new CorsConfiguration();

configuration.setAllowedOrigins(Collections.singletonList("http://localhost:3000")); //프론트 서버의 주소
configuration.setAllowedOrigins(Collections.singletonList("http://localhost:3000/**")); //프론트 서버의 주소
configuration.setAllowedMethods(Collections.singletonList("*")); //GET, POST, PUT등 모든 요청 허용
configuration.setAllowCredentials(true);
configuration.setAllowedHeaders(Collections.singletonList("*")); //모든 헤더 허용
Expand Down

0 comments on commit f244cdc

Please sign in to comment.