Skip to content

Commit

Permalink
Merge pull request #62 from devocean-finut/fix/issue
Browse files Browse the repository at this point in the history
#60 Fix cors : cors μ„€μ • μˆ˜μ •
  • Loading branch information
plum-king authored Nov 14, 2024
2 parents b16d9c8 + 95ae5e8 commit d0c5d26
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class CorsMvcConfig implements WebMvcConfigurer {
public void addCorsMappings(CorsRegistry corsRegistry) {
corsRegistry.addMapping("/**")
.allowedOrigins("http://localhost:3000")
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS", "HEAD")
.allowedMethods("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD")
.allowedHeaders("Authorization", "Content-Type")
.exposedHeaders("Authorization")
.allowCredentials(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ public CustomOAuth2UserService customOAuth2UserService(UsersRepository userRepos
@Bean
public CorsConfigurationSource corsConfigurationSource() {
CorsConfiguration configuration = new CorsConfiguration();
configuration.setAllowedOrigins(Arrays.asList("http://localhost:3000")); // ν”„λ‘ νŠΈμ—”λ“œ 도메인
configuration.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD")); // ν—ˆμš©ν•  HTTP λ©”μ„œλ“œ
configuration.setAllowedOrigins(Arrays.asList("http://localhost:3000", "http://ec2-15-165-175-91.ap-northeast-2.compute.amazonaws.com:8080")); configuration.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD")); // ν—ˆμš©ν•  HTTP λ©”μ„œλ“œ
configuration.setAllowedHeaders(Arrays.asList("Authorization", "Content-Type")); // ν—ˆμš©ν•  헀더
configuration.setExposedHeaders(Arrays.asList("Authorization")); // μ‘λ‹΅μ—μ„œ λ…ΈμΆœν•  헀더
configuration.setAllowCredentials(true); // 자격 증λͺ… 포함 μš”μ²­ ν—ˆμš©
Expand Down

0 comments on commit d0c5d26

Please sign in to comment.