This is an automated email from the ASF dual-hosted git repository.
yui pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu-website.git
The following commit(s) were added to refs/heads/main by this push:
new e39ca67287 optimize cors docs (#628)
e39ca67287 is described below
commit e39ca672875db308ed9f6d530da0047041a3fdce
Author: Qicz <[email protected]>
AuthorDate: Tue Jul 5 11:51:23 2022 +0800
optimize cors docs (#628)
---
docs/user-guide/property-config/gateway-property-config.md | 11 +++++++++--
.../user-guide/property-config/gateway-property-config.md | 9 ++++++++-
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/docs/user-guide/property-config/gateway-property-config.md
b/docs/user-guide/property-config/gateway-property-config.md
index 49faef4f85..b70d854920 100644
--- a/docs/user-guide/property-config/gateway-property-config.md
+++ b/docs/user-guide/property-config/gateway-property-config.md
@@ -119,10 +119,17 @@ shenyu:
allowedMethods: "*"
allowedAnyOrigin: false
allowedOrigin:
+ # format : schema://prefix spacer domain
+ # Access-Control-Allow-Origin: "http://a.apache.org,http://b.apache.org"
+ spacer: "."
domain: apache.org
prefixes:
- a # a.apache.org
- b # b.apache.org
+ origins:
+ - c.apache.org
+ - d.apache.org
+ - http://e.apache.org
allowedExpose: ""
maxAge: "18000"
allowCredentials: true
@@ -312,8 +319,8 @@ Cross filter properties:
| allowedHeaders | String | x-requested-with, authorization, Content-Type,
Authorization, credential, X-XSRF-TOKEN, token, username, client | No |
allowedHeaders, Use "," split in multiple cases. the new "allowedHeaders" will
append to "Access-Control-Allow-Headers" based on the default value and remove
the reduplicative header. |
| allowedMethods | String | "*" | No | allowedMethods |
| allowedAnyOrigin | Boolean | false | No | Whether to allow any
Origin, if it is true, directly set the `Access-Control-Allow-Origin` to the
same value as the Origin, that is, `request.getHeaders().getOrigin()`, and
discard the `allowedOrigin` configuration. |
-| allowedOrigin | AllowedOriginConfig | - | No | Configure domain such
as apache.org and domain name prefixes such as a, b. If `Origin` is
a.apache.org or b.apache.org, the value of `Access-Control-Allow-Origin` is the
same as `Origin`, that is, `request.getHeaders( ).getOrigin()` |
-| allowedExpose | String | "" | No | 允许的Expose |
+| allowedOrigin | AllowedOriginConfig | - | No | Configure `domain`
such as apache.org, domain name `prefixes` such as a, b and `spacer` such as
"." or directly use `origins` configuration such as c.apche.org,
http://d.apache.org. If `Origin` is http://a.apache.org or http://b.apache.org
or http://c.apache.org or http://d.apache.org, the value of
`Access-Control-Allow-Origin` is the same as `Origin`, that is,
`request.getHeaders( ).getOrigin()` |
+| allowedExpose | String | "" | No | allowedExpose |
| maxAge | String | "18000" | No | maxAge (ms) |
| allowCredentials | Boolean | true | No | allowCredentials |
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/property-config/gateway-property-config.md
b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/property-config/gateway-property-config.md
index b0ef21d81f..a6198117dc 100644
---
a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/property-config/gateway-property-config.md
+++
b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/property-config/gateway-property-config.md
@@ -119,10 +119,17 @@ shenyu:
allowedMethods: "*"
allowedAnyOrigin: false
allowedOrigin:
+ # format : schema://prefix spacer domain
+ # Access-Control-Allow-Origin: "http://a.apache.org,http://b.apache.org"
+ spacer: "."
domain: apache.org
prefixes:
- a # a.apache.org
- b # b.apache.org
+ origins:
+ - c.apache.org
+ - d.apache.org
+ - http://e.apache.org
maxAge: "18000"
allowCredentials: true
switchConfig:
@@ -311,7 +318,7 @@ Netty HttpClient 代理的相关配置:
| allowedHeaders | String | x-requested-with, authorization, Content-Type,
Authorization, credential, X-XSRF-TOKEN, token, username, client | No |
允许的Header头,多个请用 ","
分割。新的"allowedHeaders"会在默认值基础上,去除重复的追加到"Access-Control-Allow-Headers"。 |
| allowedMethods | String | "*" | No | 允许的方法 |
| allowedAnyOrigin | Boolean | false | No |
是否允许任意Origin,为true时直接将`Access-Control-Allow-Origin`设置值与Origin相同,即`request.getHeaders().getOrigin()`,同时丢弃`allowedOrigin`配置
|
-| allowedOrigin | AllowedOriginConfig | - | No |
配置domain如apache.org及域名prefixes如a,b,如果`Origin`为a.apache.org或b.apache.org时`Access-Control-Allow-Origin`设置值与`Origin`相同,即`request.getHeaders().getOrigin()`
|
+| allowedOrigin | AllowedOriginConfig | - | No |
配置`domain`如apache.org,域名`prefixes`如a,b及`spacer`如".",或直接使用`origins`配置如c.apche.org,http://d.apache.org,
如果`Origin`为http://a.apache.org或http://b.apache.org或http://c.apache.org或http://d.apache.org时`Access-Control-Allow-Origin`设置值与`Origin`相同,即`request.getHeaders().getOrigin()`
|
| allowedExpose | String | "" | No | 允许的Expose |
| maxAge | String | "18000" | No | 最大年龄 (ms) |
| allowCredentials | Boolean | true | No | 允许认证 |