Skip to content

Commit 2d85def

Browse files
committed
Merge origin/main into main
2 parents 54ece00 + b2365bf commit 2d85def

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

โ€Žsrc/main/java/com/daramg/server/auth/config/SecurityConfig.javaโ€Ž

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
3535
.headers(headers -> headers.frameOptions(frame -> frame.sameOrigin())) // ์ถ”๊ฐ€: h2 db ์ ‘๊ทผ
3636
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
3737
.authorizeHttpRequests(auth -> auth
38+
/**
39+
* CORS preflight ์š”์ฒญ ํ—ˆ์šฉ
40+
*/
41+
.requestMatchers(HttpMethod.OPTIONS, "/**").permitAll()
42+
3843
/**
3944
* ์ธ์ฆ ์—†์ด ํ—ˆ์šฉํ•  ๊ฒฝ๋กœ
4045
*/

โ€Žsrc/main/java/com/daramg/server/auth/filter/JwtAuthorizationFilter.javaโ€Ž

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ public class JwtAuthorizationFilter extends OncePerRequestFilter {
3838
@Value("${cookie.access-name}")
3939
public String ACCESS_COOKIE_NAME;
4040

41+
@Override
42+
protected boolean shouldNotFilter(@NotNull HttpServletRequest request) {
43+
return "OPTIONS".equalsIgnoreCase(request.getMethod());
44+
}
45+
4146
@Override
4247
protected void doFilterInternal(@NotNull HttpServletRequest request,
4348
@NotNull HttpServletResponse response,

โ€Žsrc/main/resources/application.ymlโ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,7 @@ cors:
4545
- "https://classic-daramg.duckdns.org"
4646
- "https://client-amber-sigma.vercel.app"
4747
- "https://client-kwongeonwoos-projects.vercel.app"
48+
- "https://www.classicaldaramg.com"
49+
- "https://classicaldaramg.com"
4850
- "https://www.classicaldaramz.com"
4951
- "https://classicaldaramz.com"

0 commit comments

Comments
ย (0)