From 406e9a393fc64748fd3c53c6ef1d489fccf92d20 Mon Sep 17 00:00:00 2001 From: Hyunmin Choi Date: Wed, 1 Jan 2025 12:16:50 +0900 Subject: [PATCH] =?UTF-8?q?[BUG]=20Swagger=20CORS=20=EC=98=A4=EB=A5=98=20(?= =?UTF-8?q?#140)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: Swagger CORS 오류 (#139) * test: Swagger CORS 오류 (#139) * fix: Swagger CORS 오류 해결 (#139) --- .../java/com/smunity/server/global/config/SwaggerConfig.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/smunity/server/global/config/SwaggerConfig.java b/src/main/java/com/smunity/server/global/config/SwaggerConfig.java index bd62683..08b1b1f 100644 --- a/src/main/java/com/smunity/server/global/config/SwaggerConfig.java +++ b/src/main/java/com/smunity/server/global/config/SwaggerConfig.java @@ -5,6 +5,7 @@ import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.security.SecurityRequirement; import io.swagger.v3.oas.models.security.SecurityScheme; +import io.swagger.v3.oas.models.servers.Server; import lombok.RequiredArgsConstructor; import org.springframework.boot.info.GitProperties; import org.springframework.context.annotation.Bean; @@ -20,6 +21,7 @@ public class SwaggerConfig { public OpenAPI openAPI() { return new OpenAPI() .info(info()) + .addServersItem(new Server().url("/")) .components(new Components().addSecuritySchemes("access-token", securityScheme())) .addSecurityItem(new SecurityRequirement().addList("access-token")); }