From 042b796d895c63afc2ca2a8b019d9297508f58aa Mon Sep 17 00:00:00 2001 From: hong Date: Fri, 22 Sep 2023 01:28:51 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=82=AC=EC=9A=A9=EC=9E=90=EC=9D=98=20l?= =?UTF-8?q?evel=EC=9D=84=20map=EC=9D=84=20=ED=86=B5=ED=95=B4=20=EC=A0=84?= =?UTF-8?q?=EB=8B=AC=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/question/controller/QuestionController.java | 10 +++++++--- .../global/config/WebSecurityConfig.java | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/codingFriends_Server/domain/question/controller/QuestionController.java b/src/main/java/codingFriends_Server/domain/question/controller/QuestionController.java index fae0ea0..a58faa1 100644 --- a/src/main/java/codingFriends_Server/domain/question/controller/QuestionController.java +++ b/src/main/java/codingFriends_Server/domain/question/controller/QuestionController.java @@ -15,7 +15,10 @@ import java.io.UnsupportedEncodingException; import java.net.URLEncoder; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.Objects; @RestController @RequiredArgsConstructor @@ -44,10 +47,11 @@ public ResponseEntity getQuestionTitleFromLanguage( return ResponseEntity.ok() .body("question이 비어있습니다."); } - String encoded_level = URLEncoder.encode(level, "UTF-8"); + Map resultMap = new HashMap<>(); + resultMap.put("quiz", questionList); + resultMap.put("level", level); return ResponseEntity.ok() - .header("level", encoded_level) - .body(questionList); + .body(resultMap); } @GetMapping("/question/get/{id}") // id로 question 조회 diff --git a/src/main/java/codingFriends_Server/global/config/WebSecurityConfig.java b/src/main/java/codingFriends_Server/global/config/WebSecurityConfig.java index cdd8bbf..3d3ccdd 100644 --- a/src/main/java/codingFriends_Server/global/config/WebSecurityConfig.java +++ b/src/main/java/codingFriends_Server/global/config/WebSecurityConfig.java @@ -13,7 +13,7 @@ public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") .allowedOrigins("https://coding-friends-client-21s6.vercel.app") // 허용할 도메인(Origin)을 명시적으로 지정 .allowedHeaders("*") - .exposedHeaders("accessToken", "refreshToken","validation","level") + .exposedHeaders("accessToken", "refreshToken","validation") .allowedMethods( HttpMethod.GET.name(), HttpMethod.POST.name(),