Bug 1309358 - P1: Add wildcard to Access-Control-Expose-Headers r=baku

For requests without credentials, add wildcard to Access-Control-Expose-Headers.

Differential Revision: https://phabricator.services.mozilla.com/D36624
This commit is contained in:
Kershaw Chang
2019-07-16 08:50:14 +00:00
parent 3d401d3165
commit e370b0c73a
7 changed files with 39 additions and 29 deletions

View File

@@ -1029,10 +1029,14 @@ bool XMLHttpRequestMainThread::IsSafeHeader(
if (!NS_IsValidHTTPToken(token)) {
return false;
}
if (aHeader.Equals(token, nsCaseInsensitiveCStringComparator())) {
if (token.EqualsLiteral("*") && !mFlagACwithCredentials) {
isSafe = true;
} else if (aHeader.Equals(token, nsCaseInsensitiveCStringComparator())) {
isSafe = true;
}
}
return isSafe;
}