-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #209 from Troth-Cam/fix/product
fix(#125) : WebConfig 수정
- Loading branch information
Showing
2 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package trothly.trothcam.config; | ||
|
||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.web.servlet.config.annotation.CorsRegistry; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
|
||
import java.util.Arrays; | ||
|
||
@Configuration | ||
public class WebConfig implements WebMvcConfigurer { | ||
@Override | ||
public void addCorsMappings(CorsRegistry registry) { | ||
registry.addMapping("/**") | ||
.allowedOriginPatterns("http://localhost:8080","http://localhost:3000", "https://trothly.com") // 허용할 출처 | ||
.allowedMethods("*") // 허용할 HTTP method | ||
.allowCredentials(true) // 쿠키 인증 요청 허용 | ||
.allowedHeaders("*") | ||
.maxAge(3600L); // 원하는 시간만큼 pre-flight 리퀘스트를 캐싱 | ||
} | ||
} |