Skip to content

Commit

Permalink
fix: allowCredentials 옵션 및 허용 헤더 추가 (#496)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamjooon2 authored Oct 18, 2023
1 parent ebc10b4 commit 5ba559e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions backend/src/main/java/zipgo/common/config/WebConfig.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package zipgo.common.config;

import java.util.List;

import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
Expand All @@ -14,6 +15,7 @@
import zipgo.common.interceptor.LoggingInterceptor;

import static org.springframework.http.HttpHeaders.LOCATION;
import static org.springframework.http.HttpHeaders.SET_COOKIE;

@Configuration
@RequiredArgsConstructor
Expand All @@ -34,8 +36,14 @@ public class WebConfig implements WebMvcConfigurer {
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping(ALLOW_ALL_PATH)
.allowedMethods(ALLOWED_METHODS)
.allowedOrigins(MAIN_SERVER_DOMAIN, DEV_SERVER_DOMAIN, FRONTEND_LOCALHOST, HTTPS_FRONTEND_LOCALHOST)
.exposedHeaders(LOCATION);
.allowedOrigins(
MAIN_SERVER_DOMAIN,
DEV_SERVER_DOMAIN,
FRONTEND_LOCALHOST,
HTTPS_FRONTEND_LOCALHOST
)
.allowCredentials(true)
.exposedHeaders(LOCATION, SET_COOKIE);
}

@Override
Expand Down

0 comments on commit 5ba559e

Please sign in to comment.