diff --git a/src/main/java/dev/goormthon/ppoori/domain/comment/CommentController.java b/src/main/java/dev/goormthon/ppoori/domain/comment/CommentController.java index 8cbfd57..e9ded70 100644 --- a/src/main/java/dev/goormthon/ppoori/domain/comment/CommentController.java +++ b/src/main/java/dev/goormthon/ppoori/domain/comment/CommentController.java @@ -3,13 +3,11 @@ import dev.goormthon.ppoori.domain.comment.dto.CommentRequest; import dev.goormthon.ppoori.global.common.BaseResponseDto; import lombok.AllArgsConstructor; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import static dev.goormthon.ppoori.global.status.SuccessStatus.COMMENT_SAVE_SUCCESS; +@CrossOrigin(origins = "*", allowedHeaders = "*") @AllArgsConstructor @RestController public class CommentController { diff --git a/src/main/java/dev/goormthon/ppoori/domain/policy/PolicyController.java b/src/main/java/dev/goormthon/ppoori/domain/policy/PolicyController.java index 74784af..bbfe0de 100644 --- a/src/main/java/dev/goormthon/ppoori/domain/policy/PolicyController.java +++ b/src/main/java/dev/goormthon/ppoori/domain/policy/PolicyController.java @@ -10,6 +10,7 @@ import static dev.goormthon.ppoori.global.status.SuccessStatus.*; +@CrossOrigin(origins = "*", allowedHeaders = "*") @AllArgsConstructor @RestController public class PolicyController { diff --git a/src/main/java/dev/goormthon/ppoori/global/config/WebConfig.java b/src/main/java/dev/goormthon/ppoori/global/config/WebConfig.java index 6cb89a8..1c5d85b 100644 --- a/src/main/java/dev/goormthon/ppoori/global/config/WebConfig.java +++ b/src/main/java/dev/goormthon/ppoori/global/config/WebConfig.java @@ -8,17 +8,16 @@ @Configuration public class WebConfig { - - @Bean - public CorsFilter corsFilter() { - UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); - CorsConfiguration config = new CorsConfiguration(); - config.setAllowCredentials(true); - config.addAllowedOriginPattern("*"); - config.addAllowedHeader("*"); - config.addAllowedMethod("*"); - - source.registerCorsConfiguration("/api/**", config); - return new CorsFilter(source); - } +// @Bean +// public CorsFilter corsFilter() { +// UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); +// CorsConfiguration config = new CorsConfiguration(); +// config.setAllowCredentials(true); +// config.addAllowedOriginPattern("*"); +// config.addAllowedHeader("*"); +// config.addAllowedMethod("*"); +// +// source.registerCorsConfiguration("/api/**", config); +// return new CorsFilter(source); +// } }