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
Describe the bug
When configuring "Allow credentials" in CORS support on an API, multiple Access-Control-Allow-Credentials can be returned if the upstream API adds the header to the response.
Browsers do not support multiple of this header; Chrome logs the following in console:
Access to XMLHttpRequest at 'http://www.tyk-test.com:8080/testapi' from origin 'http://localhost:4200' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Credentials' header in the response is 'true, true' which must be 'true' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
Branch/Environment/Version
Describe the bug
When configuring "Allow credentials" in CORS support on an API, multiple
Access-Control-Allow-Credentials
can be returned if the upstream API adds the header to the response.Browsers do not support multiple of this header; Chrome logs the following in console:
Reproduction steps
Origin
header on request.Actual behavior
Multiple
Access-Control-Allow-Credentials
headers are returned in the response.Expected behavior
Only a single
Access-Control-Allow-Credentials
header should be returned.Screenshots/Video
Configuration (tyk config file):
API CORS config:
Additional context
This is closely related to #2199. I believe it'd be worth the effort to review all CORS headers to avoid other similar issues.
The text was updated successfully, but these errors were encountered: