Skip to content

Commit

Permalink
Merge pull request #49 from 4bujak-4bujak/feature/cors
Browse files Browse the repository at this point in the history
refactor: Cors Allowed Origins 추가
  • Loading branch information
zoomin3022 authored May 28, 2024
2 parents ba66834 + 694257d commit 27e9353
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
@Bean
public CorsConfigurationSource corsConfigurationSource() {
CorsConfiguration config = new CorsConfiguration();
config.setAllowedOriginPatterns(Arrays.asList("http://localhost:3000", "http://172.30.1.*", "http://localhost:8080"));
config.setAllowedOriginPatterns(Arrays.asList(ALLOWED_ORIGINS));
config.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "PATCH", "DELETE"));
config.setAllowCredentials(true);
config.setAllowedHeaders(Arrays.asList(ALLOWED_HEADERS));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ public class SecurityConstants {
"Cache-Control", "Referer", "Content-Disposition"
};

public static final String[] ALLOWED_ORIGINS = {
"http://localhost:3000", "http://172.30.1.*", "http://localhost:8080",
"https://4busak.vercel.app","https://4busak-git-main-eunhaks-projects.vercel.app","https://4busak-hqmkp0gky-eunhaks-projects.vercel.app",
"https://*.vercel.app"
};

public static final String[] PERMIT_ALL_GET_ENDPOINTS = {
"/posts",
"/posts/{postId}"
Expand Down

0 comments on commit 27e9353

Please sign in to comment.