mirror of
https://github.com/strapi/strapi.git
synced 2025-12-28 23:57:32 +00:00
Fix CORS response headers.
The combination of `Access-Control-Allow-Credentials: true` and `Access-Control-Allow-Origin: *` is illegal for CORS specifications: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
This commit is contained in:
parent
8b2108a940
commit
556c0e789d
@ -40,7 +40,7 @@ module.exports = config => {
|
||||
|
||||
const requestOrigin = ctx.accept.headers.origin;
|
||||
if (whitelist.includes('*')) {
|
||||
return '*';
|
||||
return credentials ? requestOrigin : '*';
|
||||
}
|
||||
|
||||
if (!whitelist.includes(requestOrigin)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user