Skip to content

Commit

Permalink
Merge pull request #33 from Central-MakeUs/dev
Browse files Browse the repository at this point in the history
fix: webconfig 어노테이션 누락 수정
  • Loading branch information
KarmaPol authored Feb 4, 2024
2 parents 313811a + 58db8a8 commit 77112ab
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
@ApiResponse(responseCode = "404/0004", description = "존재하지 않는 찜하기입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "401/0001", description = "리퀘스트 토큰이 만료되었으니 다시 로그인 해주세요.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "401/0002", description = "어세스 토큰이 만료되었으니 재발급 해주세요.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "500", description = "서버 에러 발생"),
@ApiResponse(responseCode = "500", description = "서버 에러 발생", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
})
public @interface SwaggerResponseDib {
}
4 changes: 3 additions & 1 deletion api/src/main/java/com/mm/api/config/WebMvcConfig.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
package com.mm.api.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("/**")
.allowedHeaders("*")
.allowedMethods("GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS")
.allowedMethods("HEAD", "GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS")
.allowCredentials(true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
.cors().configurationSource(request -> {
CorsConfiguration cors = new CorsConfiguration();
cors.setAllowedOrigins(List.of("*"));
cors.setAllowedMethods(List.of("HEAD", "POST", "GET", "DELETE", "PUT", "OPTIONS"));
cors.setAllowedMethods(List.of("HEAD", "GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"));
cors.setAllowedHeaders(List.of("*"));
cors.setAllowCredentials(true);
return cors;
Expand Down

0 comments on commit 77112ab

Please sign in to comment.