Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ public void registerStompEndpoints(StompEndpointRegistry registry) {
.setAllowedOriginPatterns(
"http://localhost:5173",
"http://localhost:8080",
"https://z-igma.netlify.app"
"https://z-igma.netlify.app",
"https://z-igma.vercel.app"
Comment on lines +24 to +25

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

허용된 오리진(Allowed Origins) 목록을 소스 코드에 직접 하드코딩하는 대신, application.yml과 같은 설정 파일로 분리하여 관리하는 것을 권장합니다.

현재 WebConfigWebSocketConfig 두 곳에서 동일한 URL 목록을 중복 관리하고 있어 유지보수 시 누락될 위험이 있습니다. 또한, WebConfig에는 포함되지 않은 http://localhost:8080WebSocketConfig에만 명시되어 있는 등 설정의 불일치가 발견됩니다.

@Value 또는 @ConfigurationProperties를 사용하여 설정 파일로부터 오리진 목록을 주입받아 두 설정 클래스에서 공통으로 사용하면 일관성을 유지하고 관리를 단순화할 수 있습니다.

예시:

# application.yml
app:
  cors:
    allowed-origins:
      - http://localhost:5173
      - http://localhost:8080
      - https://z-igma.netlify.app
      - https://z-igma.vercel.app

);
}

Expand Down
Loading