Cross Origin Resource Sharing
CORS Plugin
The CORS plugin enables the CORS Envoy filter for EnRoute Ingress Gateway or Standalone Gateway
CORS Filter Configuration
CORS filter configuration needs the following config
Field | Description |
---|---|
match_condition | Match condition is one of - ["exact", "prefix", "suffix", "contains", "regex"] |
access_control_allow_methods | Specifies the content for the access-control-allow-methods header |
access_control_allow_headers | Specifies the content for the access-control-allow-headers header |
access_control_expose_headers | Specifies the content for the access-control-expose-headers header. |
access_control_max_age | Specifies the content for the access-control-max-age header. |
CORS Filter Config Example
{
"match_condition" : {
"regex" : "\\*"
},
"access_control_allow_methods" : "GET, OPTIONS",
"access_control_allow_headers" : "Content-Type",
"access_control_expose_headers" : "*",
"access_control_max_age" : "120"
}
Notes
CORS Filter Config for Kubernetes | CORS Filter Config for Standalone |
|
|
---|
Notes
CORS plugin is included with OSS Edition
Lua plugin is a global HttpFilter. It sets configuration on the Listener and is applicable to all GatewayHost
when defined.