Skip to content

Commit

Permalink
hotfix: cors 도메인 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
TaeyeonRoyce committed Aug 12, 2024
1 parent 3ae47df commit 592c1de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server-profile-submodule
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.celuveat.common.adapter.`in`.rest

import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Configuration
import org.springframework.http.HttpHeaders.AUTHORIZATION
import org.springframework.http.HttpMethod.DELETE
Expand All @@ -12,10 +13,13 @@ import org.springframework.web.servlet.config.annotation.CorsRegistry
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer

@Configuration
class CorsConfig : WebMvcConfigurer {
class CorsConfig(
@Value("\${cors.allowed_origins}")
private val allowedOrigins: Set<String>,
) : WebMvcConfigurer {
override fun addCorsMappings(registry: CorsRegistry) {
registry.addMapping("/**")
.allowedOrigins("http://localhost:3000")
.allowedOrigins(*allowedOrigins.toTypedArray())
.allowedMethods(
OPTIONS.name(),
GET.name(),
Expand Down

0 comments on commit 592c1de

Please sign in to comment.