Skip to content

Commit

Permalink
Merge fac9031 into 9f1af82
Browse files Browse the repository at this point in the history
  • Loading branch information
msa0311 committed Mar 4, 2021
2 parents 9f1af82 + fac9031 commit 770a943
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/cors-anywhere.js
Expand Up @@ -65,6 +65,11 @@ function withCORS(headers, request) {
delete request.headers['access-control-request-headers'];
}

//If "Access-Control-Allow-Credentials" is "true", "Access-Control-Allow-Origin" cannot be "*"!
//https://github.com/Rob--W/cors-anywhere/issues/330
if (headers['access-control-allow-credentials']) {
headers['access-control-allow-origin'] = request.headers['origin'];
}
headers['access-control-expose-headers'] = Object.keys(headers).join(',');

return headers;
Expand Down

0 comments on commit 770a943

Please sign in to comment.