Skip to content

Commit

Permalink
feat: Cors를 배열로 변경 #357
Browse files Browse the repository at this point in the history
  • Loading branch information
jhon3242 committed Oct 22, 2024
1 parent 0aaf9bb commit fa8adfb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backend/src/main/java/ddangkong/config/CorsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
@Configuration
public class CorsConfig implements WebMvcConfigurer {

private final String corsOrigin;
private final String[] corsOrigin;

public CorsConfig(@Value("${cors.origin}") String corsOrigin) {
public CorsConfig(@Value("${cors.origin}") String[] corsOrigin) {
this.corsOrigin = corsOrigin;
}

Expand All @@ -22,6 +22,7 @@ public void addCorsMappings(CorsRegistry registry) {
.allowedMethods(
HttpMethod.GET.name(), HttpMethod.POST.name(), HttpMethod.PATCH.name(), HttpMethod.DELETE.name()
)
.allowCredentials(true)
.allowedHeaders("*");
}
}

0 comments on commit fa8adfb

Please sign in to comment.