You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/spring-cloud-gateway-server-webflux/cors-configuration.adoc
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,17 +17,19 @@ The following example configures CORS:
17
17
spring:
18
18
cloud:
19
19
gateway:
20
-
globalcors:
21
-
cors-configurations:
22
-
'[/**]':
23
-
allowedOrigins: "https://docs.spring.io"
24
-
allowedMethods:
25
-
- GET
20
+
server:
21
+
webflux:
22
+
globalcors:
23
+
cors-configurations:
24
+
'[/**]':
25
+
allowedOrigins: "https://docs.spring.io"
26
+
allowedMethods:
27
+
- GET
26
28
----
27
29
28
30
In the preceding example, CORS requests are allowed from requests that originate from `docs.spring.io` for all GET requested paths.
29
31
30
-
To provide the same CORS configuration to requests that are not handled by some gateway route predicate, set the `spring.cloud.gateway.globalcors.add-to-simple-url-handler-mapping` property to `true`.
32
+
To provide the same CORS configuration to requests that are not handled by some gateway route predicate, set the `spring.cloud.gateway.server.webflux.globalcors.add-to-simple-url-handler-mapping` property to `true`.
31
33
This is useful when you try to support CORS preflight requests and your route predicate does not evaluate to `true` because the HTTP method is `options`.
0 commit comments