AllowOrigins indicates whether the response can be shared with requested
resource from the given Origin.
The Origin consists of a scheme and a host, with an optional port, and
takes the form <scheme>://<host>(:<port>).
Valid values for scheme are: http and https.
Valid values for port are any integer between 1 and 65535 (the list of
available TCP/UDP ports). Note that, if not included, port 80 is
assumed for http scheme origins, and port 443 is assumed for https
origins. This may affect origin matching.
The host part of the origin may contain the wildcard character . These
wildcard characters behave as follows:
* is a greedy match to the left, including any number of
DNS labels to the left of its position. This also means that
will include any number of period . characters to the
left of its position.
* A wildcard by itself matches all hosts.
An origin value that includes only the character indicates requests
from all Origin`s are allowed.
When the `AllowOrigins field is configured with multiple origins, it
means the server supports clients from multiple origins. If the request
Origin matches the configured allowed origins, the gateway must return
the given Origin and sets value of the header
Access-Control-Allow-Origin same as the Origin header provided by the
client.
The status code of a successful response to a "preflight" request is
always an OK status (i.e., 204 or 200).
If the request Origin does not match the configured allowed origins,
the gateway returns 204/200 response but doesn’t set the relevant
cross-origin response headers. Alternatively, the gateway responds with
403 status to the "preflight" request is denied, coupled with omitting
the CORS headers. The cross-origin request fails on the client side.
Therefore, the client doesn’t attempt the actual cross-origin request.
Conversely, if the request Origin matches one of the configured
allowed origins, the gateway sets the response header
Access-Control-Allow-Origin to the same value as the Origin
header provided by the client.
When config has the wildcard ("") in allowOrigins, and the request
is not credentialed (e.g., it is a preflight request), the
Access-Control-Allow-Origin response header either contains the
wildcard as well or the Origin from the request.
When the request is credentialed, the gateway must not specify the
wildcard in the Access-Control-Allow-Origin response header. When
also the AllowCredentials field is true and AllowOrigins field
specified with the wildcard, the gateway must return a single origin
in the value of the Access-Control-Allow-Origin response header,
instead of specifying the wildcard. The value of the header
Access-Control-Allow-Origin is same as the Origin header provided by
the client.
Support: Extended |