Skip to content

Commit

Permalink
feat: localhost추가한 cors
Browse files Browse the repository at this point in the history
  • Loading branch information
minseok1015 committed Aug 17, 2024
1 parent ec4b3cb commit 4f39e44
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/main/java/store/itpick/backend/config/WebConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,20 @@ public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers)
resolvers.add(getJwtHandlerArgumentResolver);
}

// @Override
// public void addCorsMappings(CorsRegistry registry) {
// registry.addMapping("/**")
// .allowedOrigins("https://itpick.netlify.app")
// .allowedMethods("GET", "POST", "PUT", "DELETE", "HEAD")
// .allowedHeaders("Authorization", "Content-Type")
// .allowCredentials(true);
// }


@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOriginPatterns("http://localhost:3000/", "http://localhost:5173/", "https://localhost:5173/",
"https://itpick.netlify.app")
.allowedMethods("GET", "POST", "PUT", "DELETE", "PATCH")
.exposedHeaders("location", "Authorization")
.allowedHeaders("*")
.allowCredentials(true);
}




}

0 comments on commit 4f39e44

Please sign in to comment.