Skip to content

Commit c0ac05d

Browse files
authored
Merge pull request #52 from prgrms-web-devcourse-final-project/QUZ-101-user-bugfix
[QUZ-101][HOTFIX] sockJS 웹소켓 연결 안되는 이슈 수정
2 parents 6164a8c + 4da6999 commit c0ac05d

File tree

3 files changed

+24
-23
lines changed

3 files changed

+24
-23
lines changed

gateway-service/src/main/kotlin/com/grepp/quizy/config/SecurityConfig.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ class SecurityConfig() {
1818
.csrf { it.disable() }
1919
.httpBasic { it.disable() }
2020
.formLogin { it.disable() }
21+
.cors { it.disable() }
22+
.authorizeExchange {
23+
it.anyExchange().permitAll()
24+
}
2125
.build()
2226
}
2327
}

gateway-service/src/main/kotlin/com/grepp/quizy/global/AuthGlobalFilter.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ class RouteValidator {
132132
"/api/quiz/feed",
133133
"/api/quiz/search",
134134
"/api/user/info/",
135-
"/login/oauth2/code"
135+
"/login/oauth2/code",
136+
"/ws/info"
136137
)
137138

138139
fun isUnsecured(request: ServerHttpRequest): Boolean {

gateway-service/src/main/resources/application.yml

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ spring:
1313
web-application-type: reactive
1414
cloud:
1515
gateway:
16+
default-filters:
17+
- DedupeResponseHeader=Access-Control-Allow-Credentials Access-Control-Allow-Origin
1618
globalcors:
1719
cors-configurations:
1820
'[/**]':
@@ -27,18 +29,21 @@ spring:
2729
- PATCH
2830
- OPTIONS
2931
allowedHeaders:
30-
- "Access-Control-Allow-Headers"
31-
- "Access-Control-Allow-Origin"
32-
- "Access-Control-Request-Method"
33-
- "Access-Control-Request-Headers"
34-
- "Origin"
35-
- "Cache-Control"
36-
- "Content-Type"
37-
- "Authorization"
38-
- "X-Requested-With"
39-
- "credentials"
40-
- "If-None-Match"
41-
- "Accept"
32+
# - "Access-Control-Allow-Headers"
33+
# - "Access-Control-Allow-Origin"
34+
# - "Access-Control-Request-Method"
35+
# - "Access-Control-Request-Headers"
36+
# - "Origin"
37+
# - "Cache-Control"
38+
# - "Content-Type"
39+
# - "Authorization"
40+
# - "X-Requested-With"
41+
# - "credentials"
42+
# - "If-None-Match"
43+
# - "Accept"
44+
# - "Upgrade"
45+
# - "Connection"
46+
- "*"
4247
allowCredentials: true
4348

4449
---
@@ -77,15 +82,11 @@ spring:
7782
uri: http://localhost:8085
7883
predicates:
7984
- Path=/login/**
80-
- id: websocket
81-
uri: ws://localhost:8081
82-
predicates:
83-
- Path=/ws/**
8485
- id: sockjs
8586
uri: http://localhost:8081
8687
predicates:
8788
- Path=/ws/**
88-
- Query=transport, websocket
89+
8990
data:
9091
redis:
9192
host: localhost
@@ -157,15 +158,10 @@ spring:
157158
uri: http://dev-user-service:8080
158159
predicates:
159160
- Path=/login/**
160-
- id: websocket
161-
uri: ws://dev-game-service:8080
162-
predicates:
163-
- Path=/ws/**
164161
- id: sockjs
165162
uri: http://dev-game-service:8080
166163
predicates:
167164
- Path=/ws/**
168-
- Query=transport, websocket
169165

170166
kubernetes:
171167
discovery:

0 commit comments

Comments
 (0)