Merge remote-tracking branch 'origin/tracking' into custom

This commit is contained in:
roytam1 2022-11-10 14:55:46 +08:00
commit f9dc0e6d15
31 changed files with 913 additions and 892 deletions

Binary file not shown.

View file

@ -537,7 +537,8 @@ FetchDriver::OnStartRequest(nsIRequest* aRequest,
nsAutoCString statusText; nsAutoCString statusText;
httpChannel->GetResponseStatusText(statusText); httpChannel->GetResponseStatusText(statusText);
response = new InternalResponse(responseStatus, statusText); response = new InternalResponse(responseStatus, statusText,
mRequest->GetCredentialsMode());
RefPtr<FillResponseHeaders> visitor = new FillResponseHeaders(response); RefPtr<FillResponseHeaders> visitor = new FillResponseHeaders(response);
rv = httpChannel->VisitResponseHeaders(visitor); rv = httpChannel->VisitResponseHeaders(visitor);
@ -556,7 +557,8 @@ FetchDriver::OnStartRequest(nsIRequest* aRequest,
} }
MOZ_ASSERT(!result.Failed()); MOZ_ASSERT(!result.Failed());
} else { } else {
response = new InternalResponse(200, NS_LITERAL_CSTRING("OK")); response = new InternalResponse(200, NS_LITERAL_CSTRING("OK"),
mRequest->GetCredentialsMode());
ErrorResult result; ErrorResult result;
nsAutoCString contentType; nsAutoCString contentType;

View file

@ -364,7 +364,7 @@ InternalHeaders::BasicHeaders(InternalHeaders* aHeaders)
// static // static
already_AddRefed<InternalHeaders> already_AddRefed<InternalHeaders>
InternalHeaders::CORSHeaders(InternalHeaders* aHeaders) InternalHeaders::CORSHeaders(InternalHeaders* aHeaders, RequestCredentials aCredentialsMode)
{ {
RefPtr<InternalHeaders> cors = new InternalHeaders(aHeaders->mGuard); RefPtr<InternalHeaders> cors = new InternalHeaders(aHeaders->mGuard);
ErrorResult result; ErrorResult result;
@ -373,6 +373,7 @@ InternalHeaders::CORSHeaders(InternalHeaders* aHeaders)
aHeaders->GetFirst(NS_LITERAL_CSTRING("Access-Control-Expose-Headers"), acExposedNames, result); aHeaders->GetFirst(NS_LITERAL_CSTRING("Access-Control-Expose-Headers"), acExposedNames, result);
MOZ_ASSERT(!result.Failed()); MOZ_ASSERT(!result.Failed());
bool allowAllHeaders = false;
AutoTArray<nsCString, 5> exposeNamesArray; AutoTArray<nsCString, 5> exposeNamesArray;
nsCCharSeparatedTokenizer exposeTokens(acExposedNames, ','); nsCCharSeparatedTokenizer exposeTokens(acExposedNames, ',');
while (exposeTokens.hasMoreTokens()) { while (exposeTokens.hasMoreTokens()) {
@ -388,19 +389,27 @@ InternalHeaders::CORSHeaders(InternalHeaders* aHeaders)
break; break;
} }
if (token.EqualsLiteral("*") &&
aCredentialsMode != RequestCredentials::Include) {
allowAllHeaders = true;
}
exposeNamesArray.AppendElement(token); exposeNamesArray.AppendElement(token);
} }
nsCaseInsensitiveCStringArrayComparator comp; nsCaseInsensitiveCStringArrayComparator comp;
for (uint32_t i = 0; i < aHeaders->mList.Length(); ++i) { for (uint32_t i = 0; i < aHeaders->mList.Length(); ++i) {
const Entry& entry = aHeaders->mList[i]; const Entry& entry = aHeaders->mList[i];
if (entry.mName.EqualsASCII("cache-control") || if (allowAllHeaders) {
entry.mName.EqualsASCII("content-language") || cors->Append(entry.mName, entry.mValue, result);
entry.mName.EqualsASCII("content-type") || MOZ_ASSERT(!result.Failed());
entry.mName.EqualsASCII("expires") || } else if (entry.mName.EqualsASCII("cache-control") ||
entry.mName.EqualsASCII("last-modified") || entry.mName.EqualsASCII("content-language") ||
entry.mName.EqualsASCII("pragma") || entry.mName.EqualsASCII("content-type") ||
exposeNamesArray.Contains(entry.mName, comp)) { entry.mName.EqualsASCII("expires") ||
entry.mName.EqualsASCII("last-modified") ||
entry.mName.EqualsASCII("pragma") ||
exposeNamesArray.Contains(entry.mName, comp)) {
cors->Append(entry.mName, entry.mValue, result); cors->Append(entry.mName, entry.mValue, result);
MOZ_ASSERT(!result.Failed()); MOZ_ASSERT(!result.Failed());
} }

View file

@ -8,6 +8,7 @@
// needed for HeadersGuardEnum. // needed for HeadersGuardEnum.
#include "mozilla/dom/HeadersBinding.h" #include "mozilla/dom/HeadersBinding.h"
#include "mozilla/dom/RequestBinding.h"
#include "mozilla/dom/UnionTypes.h" #include "mozilla/dom/UnionTypes.h"
#include "nsClassHashtable.h" #include "nsClassHashtable.h"
@ -122,7 +123,8 @@ public:
BasicHeaders(InternalHeaders* aHeaders); BasicHeaders(InternalHeaders* aHeaders);
static already_AddRefed<InternalHeaders> static already_AddRefed<InternalHeaders>
CORSHeaders(InternalHeaders* aHeaders); CORSHeaders(InternalHeaders* aHeaders,
RequestCredentials mCredentialsMode = RequestCredentials::Omit);
void void
GetEntries(nsTArray<InternalHeaders::Entry>& aEntries) const; GetEntries(nsTArray<InternalHeaders::Entry>& aEntries) const;

View file

@ -17,12 +17,15 @@
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {
InternalResponse::InternalResponse(uint16_t aStatus, const nsACString& aStatusText) InternalResponse::InternalResponse(uint16_t aStatus,
const nsACString& aStatusText,
RequestCredentials aCredentialsMode)
: mType(ResponseType::Default) : mType(ResponseType::Default)
, mStatus(aStatus) , mStatus(aStatus)
, mStatusText(aStatusText) , mStatusText(aStatusText)
, mHeaders(new InternalHeaders(HeadersGuardEnum::Response)) , mHeaders(new InternalHeaders(HeadersGuardEnum::Response))
, mBodySize(UNKNOWN_BODY_SIZE) , mBodySize(UNKNOWN_BODY_SIZE)
, mCredentialsMode(aCredentialsMode)
{ {
} }
@ -183,7 +186,7 @@ InternalResponse::CORSResponse()
MOZ_ASSERT(!mWrappedResponse, "Can't CORSResponse a already wrapped response"); MOZ_ASSERT(!mWrappedResponse, "Can't CORSResponse a already wrapped response");
RefPtr<InternalResponse> cors = CreateIncompleteCopy(); RefPtr<InternalResponse> cors = CreateIncompleteCopy();
cors->mType = ResponseType::Cors; cors->mType = ResponseType::Cors;
cors->mHeaders = InternalHeaders::CORSHeaders(Headers()); cors->mHeaders = InternalHeaders::CORSHeaders(Headers(), mCredentialsMode);
cors->mWrappedResponse = this; cors->mWrappedResponse = this;
return cors.forget(); return cors.forget();
} }

View file

@ -9,9 +9,10 @@
#include "nsIInputStream.h" #include "nsIInputStream.h"
#include "nsISupportsImpl.h" #include "nsISupportsImpl.h"
#include "mozilla/dom/InternalHeaders.h"
#include "mozilla/dom/RequestBinding.h"
#include "mozilla/dom/ResponseBinding.h" #include "mozilla/dom/ResponseBinding.h"
#include "mozilla/dom/ChannelInfo.h" #include "mozilla/dom/ChannelInfo.h"
#include "mozilla/dom/InternalHeaders.h"
#include "mozilla/UniquePtr.h" #include "mozilla/UniquePtr.h"
namespace mozilla { namespace mozilla {
@ -32,7 +33,9 @@ class InternalResponse final
public: public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(InternalResponse) NS_INLINE_DECL_THREADSAFE_REFCOUNTING(InternalResponse)
InternalResponse(uint16_t aStatus, const nsACString& aStatusText); InternalResponse(uint16_t aStatus,
const nsACString& aStatusText,
RequestCredentials aCredentialsMode = RequestCredentials::Omit);
static already_AddRefed<InternalResponse> static already_AddRefed<InternalResponse>
FromIPC(const IPCInternalResponse& aIPCResponse); FromIPC(const IPCInternalResponse& aIPCResponse);
@ -294,8 +297,11 @@ private:
RefPtr<InternalHeaders> mHeaders; RefPtr<InternalHeaders> mHeaders;
nsCOMPtr<nsIInputStream> mBody; nsCOMPtr<nsIInputStream> mBody;
int64_t mBodySize; int64_t mBodySize;
RequestCredentials mCredentialsMode;
public: public:
static const int64_t UNKNOWN_BODY_SIZE = -1; static const int64_t UNKNOWN_BODY_SIZE = -1;
private: private:
ChannelInfo mChannelInfo; ChannelInfo mChannelInfo;
UniquePtr<mozilla::ipc::PrincipalInfo> mPrincipalInfo; UniquePtr<mozilla::ipc::PrincipalInfo> mPrincipalInfo;

View file

@ -1182,7 +1182,9 @@ XMLHttpRequestMainThread::IsSafeHeader(const nsACString& aHeader,
if (!NS_IsValidHTTPToken(token)) { if (!NS_IsValidHTTPToken(token)) {
return false; return false;
} }
if (aHeader.Equals(token, nsCaseInsensitiveCStringComparator())) { if (token.EqualsLiteral("*") && !mFlagACwithCredentials) {
isSafe = true;
} else if (aHeader.Equals(token, nsCaseInsensitiveCStringComparator())) {
isSafe = true; isSafe = true;
} }
} }

View file

@ -1,7 +1,5 @@
commit 95120170afa0cf622a18da37d3af58abf8ecd40e commit 51ebdd3f0f5a774050e3ebc745b5fbea2f87f26b
Author: Yoshito Umaoka <yumaoka@users.noreply.github.com> Author: yumaoka <y.umaoka@gmail.com>
Date: Wed Jan 27 09:48:37 2021 -0500 Date: Tue Nov 1 10:29:13 2022 -0400
ICU-21467 tzdata 2021a updates. Also updated build script. With this … (#17) ICU-22196 TZ Database 2022f updates (icu-data)
change, we no longer release ICU time zone data updates for ICU 4.2 or older releases.

View file

@ -1 +1 @@
2021a 2022e

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -305,9 +305,7 @@ metaZones:table(nofallback){
EG{"Africa/Cairo"} EG{"Africa/Cairo"}
FI{"Europe/Helsinki"} FI{"Europe/Helsinki"}
GR{"Europe/Athens"} GR{"Europe/Athens"}
JO{"Asia/Amman"}
LB{"Asia/Beirut"} LB{"Asia/Beirut"}
SY{"Asia/Damascus"}
} }
Europe_Further_Eastern{ Europe_Further_Eastern{
001{"Europe/Minsk"} 001{"Europe/Minsk"}
@ -708,9 +706,170 @@ metaZones:table(nofallback){
001{"Asia/Yerevan"} 001{"Asia/Yerevan"}
} }
Yukon{ Yukon{
001{"America/Yakutat"} 001{"America/Whitehorse"}
} }
} }
metazoneIds{
acre{"Acre"}
afce{"Africa_Central"}
afea{"Africa_Eastern"}
afgh{"Afghanistan"}
afso{"Africa_Southern"}
afwe{"Africa_Western"}
alam{"Almaty"}
alas{"Alaska"}
amaz{"Amazon"}
amce{"America_Central"}
amea{"America_Eastern"}
ammo{"America_Mountain"}
ampa{"America_Pacific"}
anad{"Anadyr"}
apia{"Apia"}
aqta{"Aqtau"}
aqto{"Aqtobe"}
arab{"Arabian"}
arge{"Argentina"}
arme{"Armenia"}
arwe{"Argentina_Western"}
atla{"Atlantic"}
auce{"Australia_Central"}
aucw{"Australia_CentralWestern"}
auea{"Australia_Eastern"}
auwe{"Australia_Western"}
azer{"Azerbaijan"}
azor{"Azores"}
bang{"Bangladesh"}
bhut{"Bhutan"}
boli{"Bolivia"}
bras{"Brasilia"}
brun{"Brunei"}
case{"Casey"}
cave{"Cape_Verde"}
cham{"Chamorro"}
chat{"Chatham"}
chil{"Chile"}
chin{"China"}
choi{"Choibalsan"}
chri{"Christmas"}
coco{"Cocos"}
colo{"Colombia"}
cook{"Cook"}
cuba{"Cuba"}
davi{"Davis"}
dumo{"DumontDUrville"}
east{"Easter"}
eati{"East_Timor"}
ecua{"Ecuador"}
euce{"Europe_Central"}
euea{"Europe_Eastern"}
eufe{"Europe_Further_Eastern"}
euwe{"Europe_Western"}
falk{"Falkland"}
fiji{"Fiji"}
frgu{"French_Guiana"}
frso{"French_Southern"}
gala{"Galapagos"}
gamb{"Gambier"}
geor{"Georgia"}
giis{"Gilbert_Islands"}
grea{"Greenland_Eastern"}
grwe{"Greenland_Western"}
guam{"Guam"}
gulf{"Gulf"}
guya{"Guyana"}
haal{"Hawaii_Aleutian"}
hoko{"Hong_Kong"}
hovd{"Hovd"}
ince{"Indonesia_Central"}
indi{"India"}
indo{"Indochina"}
inea{"Indonesia_Eastern"}
inoc{"Indian_Ocean"}
inwe{"Indonesia_Western"}
iran{"Iran"}
irku{"Irkutsk"}
isra{"Israel"}
japa{"Japan"}
kaea{"Kazakhstan_Eastern"}
kamc{"Kamchatka"}
kawe{"Kazakhstan_Western"}
kore{"Korea"}
kosr{"Kosrae"}
kras{"Krasnoyarsk"}
kyrg{"Kyrgystan"}
lank{"Lanka"}
liis{"Line_Islands"}
loho{"Lord_Howe"}
maca{"Macau"}
macq{"Macquarie"}
maga{"Magadan"}
mais{"Marshall_Islands"}
mala{"Malaysia"}
mald{"Maldives"}
marq{"Marquesas"}
maur{"Mauritius"}
maws{"Mawson"}
meno{"Mexico_Northwest"}
mepa{"Mexico_Pacific"}
mgmt{"GMT"}
mong{"Mongolia"}
mosc{"Moscow"}
myan{"Myanmar"}
naur{"Nauru"}
neca{"New_Caledonia"}
nepa{"Nepal"}
newf{"Newfoundland"}
neze{"New_Zealand"}
niue{"Niue"}
noma{"North_Mariana"}
norf{"Norfolk"}
noro{"Noronha"}
novo{"Novosibirsk"}
omsk{"Omsk"}
paki{"Pakistan"}
pala{"Palau"}
pang{"Papua_New_Guinea"}
para{"Paraguay"}
peru{"Peru"}
phil{"Philippines"}
phis{"Phoenix_Islands"}
pimi{"Pierre_Miquelon"}
pitc{"Pitcairn"}
pona{"Ponape"}
pyon{"Pyongyang"}
qyzy{"Qyzylorda"}
reun{"Reunion"}
roth{"Rothera"}
sakh{"Sakhalin"}
sama{"Samara"}
samo{"Samoa"}
seyc{"Seychelles"}
sing{"Singapore"}
soge{"South_Georgia"}
solo{"Solomon"}
suri{"Suriname"}
syow{"Syowa"}
tahi{"Tahiti"}
taip{"Taipei"}
taji{"Tajikistan"}
toke{"Tokelau"}
tong{"Tonga"}
truk{"Truk"}
turk{"Turkmenistan"}
tuva{"Tuvalu"}
urug{"Uruguay"}
uzbe{"Uzbekistan"}
vanu{"Vanuatu"}
vene{"Venezuela"}
vlad{"Vladivostok"}
volg{"Volgograd"}
vost{"Vostok"}
wake{"Wake"}
wall{"Wallis"}
yaku{"Yakutsk"}
yeka{"Yekaterinburg"}
yuko{"Yukon"}
}
metazoneInfo{ metazoneInfo{
"Africa:Abidjan"{ "Africa:Abidjan"{
{ {
@ -1132,11 +1291,6 @@ metaZones:table(nofallback){
"1970-01-01 00:00", "1970-01-01 00:00",
"1983-10-30 11:00", "1983-10-30 11:00",
} }
{
"Yukon",
"1983-10-30 11:00",
"1983-11-30 09:00",
}
{ {
"Alaska", "Alaska",
"1983-11-30 09:00", "1983-11-30 09:00",
@ -1552,18 +1706,13 @@ metaZones:table(nofallback){
} }
} }
"America:Dawson"{ "America:Dawson"{
{
"Yukon",
"1970-01-01 00:00",
"1973-10-28 09:00",
}
{ {
"America_Pacific", "America_Pacific",
"1973-10-28 09:00", "1973-10-28 09:00",
"2020-11-01 07:00", "2020-11-01 07:00",
} }
{ {
"America_Mountain", "Yukon",
"2020-11-01 07:00", "2020-11-01 07:00",
"9999-12-31 23:59", "9999-12-31 23:59",
} }
@ -1894,21 +2043,11 @@ metaZones:table(nofallback){
"1970-01-01 00:00", "1970-01-01 00:00",
"1980-04-27 10:00", "1980-04-27 10:00",
} }
{
"Yukon",
"1980-04-27 10:00",
"1980-10-26 10:00",
}
{ {
"America_Pacific", "America_Pacific",
"1980-10-26 10:00", "1980-10-26 10:00",
"1983-10-30 09:00", "1983-10-30 09:00",
} }
{
"Yukon",
"1983-10-30 09:00",
"1983-11-30 09:00",
}
{ {
"Alaska", "Alaska",
"1983-11-30 09:00", "1983-11-30 09:00",
@ -2169,11 +2308,6 @@ metaZones:table(nofallback){
"1970-01-01 00:00", "1970-01-01 00:00",
"1983-10-30 12:00", "1983-10-30 12:00",
} }
{
"Yukon",
"1983-10-30 12:00",
"1983-11-30 09:00",
}
{ {
"Alaska", "Alaska",
"1983-11-30 09:00", "1983-11-30 09:00",
@ -2447,11 +2581,6 @@ metaZones:table(nofallback){
"1970-01-01 00:00", "1970-01-01 00:00",
"1983-10-30 09:00", "1983-10-30 09:00",
} }
{
"Yukon",
"1983-10-30 09:00",
"1983-11-30 09:00",
}
{ {
"Alaska", "Alaska",
"1983-11-30 09:00", "1983-11-30 09:00",
@ -2542,7 +2671,7 @@ metaZones:table(nofallback){
"2020-11-01 07:00", "2020-11-01 07:00",
} }
{ {
"America_Mountain", "Yukon",
"2020-11-01 07:00", "2020-11-01 07:00",
"9999-12-31 23:59", "9999-12-31 23:59",
} }
@ -2553,11 +2682,6 @@ metaZones:table(nofallback){
} }
} }
"America:Yakutat"{ "America:Yakutat"{
{
"Yukon",
"1970-01-01 00:00",
"1983-11-30 09:00",
}
{ {
"Alaska", "Alaska",
"1983-11-30 09:00", "1983-11-30 09:00",
@ -2713,6 +2837,8 @@ metaZones:table(nofallback){
"Asia:Amman"{ "Asia:Amman"{
{ {
"Europe_Eastern", "Europe_Eastern",
"1970-01-01 00:00",
"2022-10-27 22:00",
} }
} }
"Asia:Anadyr"{ "Asia:Anadyr"{
@ -2900,6 +3026,8 @@ metaZones:table(nofallback){
"Asia:Damascus"{ "Asia:Damascus"{
{ {
"Europe_Eastern", "Europe_Eastern",
"1970-01-01 00:00",
"2022-10-27 21:00",
} }
} }
"Asia:Dhaka"{ "Asia:Dhaka"{
@ -4007,16 +4135,11 @@ metaZones:table(nofallback){
{ {
"Moscow", "Moscow",
"1970-01-01 00:00", "1970-01-01 00:00",
"1990-06-30 23:00", "1990-06-30 22:00",
}
{
"Europe_Central",
"1990-06-30 23:00",
"1991-03-31 02:00",
} }
{ {
"Europe_Eastern", "Europe_Eastern",
"1991-03-31 02:00", "1990-06-30 22:00",
"9999-12-31 23:59", "9999-12-31 23:59",
} }
} }
@ -4076,11 +4199,11 @@ metaZones:table(nofallback){
{ {
"Moscow", "Moscow",
"1970-01-01 00:00", "1970-01-01 00:00",
"1991-03-30 23:00", "1990-06-30 22:00",
} }
{ {
"Europe_Eastern", "Europe_Eastern",
"1991-03-30 23:00", "1990-06-30 22:00",
"9999-12-31 23:59", "9999-12-31 23:59",
} }
} }

View file

@ -8,6 +8,7 @@ timezoneTypes:table(nofallback){
cnckg{"cnsha"} cnckg{"cnsha"}
cnhrb{"cnsha"} cnhrb{"cnsha"}
cnkhg{"cnurc"} cnkhg{"cnurc"}
gaza{"gazastrp"}
usnavajo{"usden"} usnavajo{"usden"}
} }
} }
@ -86,12 +87,14 @@ timezoneTypes:table(nofallback){
"Etc:Universal"{"Etc/UTC"} "Etc:Universal"{"Etc/UTC"}
"Etc:Zulu"{"Etc/UTC"} "Etc:Zulu"{"Etc/UTC"}
"Europe:Belfast"{"Europe/London"} "Europe:Belfast"{"Europe/London"}
"Europe:Kyiv"{"Europe/Kiev"}
"Europe:Nicosia"{"Asia/Nicosia"} "Europe:Nicosia"{"Asia/Nicosia"}
"Europe:Tiraspol"{"Europe/Chisinau"} "Europe:Tiraspol"{"Europe/Chisinau"}
"Mexico:BajaNorte"{"America/Tijuana"} "Mexico:BajaNorte"{"America/Tijuana"}
"Mexico:BajaSur"{"America/Mazatlan"} "Mexico:BajaSur"{"America/Mazatlan"}
"Mexico:General"{"America/Mexico_City"} "Mexico:General"{"America/Mexico_City"}
"Pacific:Chuuk"{"Pacific/Truk"} "Pacific:Chuuk"{"Pacific/Truk"}
"Pacific:Kanton"{"Pacific/Enderbury"}
"Pacific:Pohnpei"{"Pacific/Ponape"} "Pacific:Pohnpei"{"Pacific/Ponape"}
"Pacific:Samoa"{"Pacific/Pago_Pago"} "Pacific:Samoa"{"Pacific/Pago_Pago"}
"Pacific:Yap"{"Pacific/Truk"} "Pacific:Yap"{"Pacific/Truk"}
@ -387,7 +390,7 @@ timezoneTypes:table(nofallback){
"Asia:Dubai"{"aedxb"} "Asia:Dubai"{"aedxb"}
"Asia:Dushanbe"{"tjdyu"} "Asia:Dushanbe"{"tjdyu"}
"Asia:Famagusta"{"cyfmg"} "Asia:Famagusta"{"cyfmg"}
"Asia:Gaza"{"gaza"} "Asia:Gaza"{"gazastrp"}
"Asia:Hebron"{"hebron"} "Asia:Hebron"{"hebron"}
"Asia:Hong_Kong"{"hkhkg"} "Asia:Hong_Kong"{"hkhkg"}
"Asia:Hovd"{"mnhvd"} "Asia:Hovd"{"mnhvd"}

View file

@ -304,6 +304,7 @@ windowsZones:table(nofallback){
BF{"Africa/Ouagadougou"} BF{"Africa/Ouagadougou"}
CI{"Africa/Abidjan"} CI{"Africa/Abidjan"}
GH{"Africa/Accra"} GH{"Africa/Accra"}
GL{"America/Danmarkshavn"}
GM{"Africa/Banjul"} GM{"Africa/Banjul"}
GN{"Africa/Conakry"} GN{"Africa/Conakry"}
GW{"Africa/Bissau"} GW{"Africa/Bissau"}
@ -609,13 +610,16 @@ windowsZones:table(nofallback){
MW{"Africa/Blantyre"} MW{"Africa/Blantyre"}
MZ{"Africa/Maputo"} MZ{"Africa/Maputo"}
RW{"Africa/Kigali"} RW{"Africa/Kigali"}
SS{"Africa/Juba"}
SZ{"Africa/Mbabane"} SZ{"Africa/Mbabane"}
ZA{"Africa/Johannesburg"} ZA{"Africa/Johannesburg"}
ZM{"Africa/Lusaka"} ZM{"Africa/Lusaka"}
ZW{"Africa/Harare"} ZW{"Africa/Harare"}
ZZ{"Etc/GMT-2"} ZZ{"Etc/GMT-2"}
} }
"South Sudan Standard Time"{
001{"Africa/Juba"}
SS{"Africa/Juba"}
}
"Sri Lanka Standard Time"{ "Sri Lanka Standard Time"{
001{"Asia/Colombo"} 001{"Asia/Colombo"}
LK{"Asia/Colombo"} LK{"Asia/Colombo"}
@ -674,14 +678,14 @@ windowsZones:table(nofallback){
} }
"US Mountain Standard Time"{ "US Mountain Standard Time"{
001{"America/Phoenix"} 001{"America/Phoenix"}
CA{"America/Creston America/Dawson_Creek America/Fort_Nelson"}
MX{"America/Hermosillo"} MX{"America/Hermosillo"}
US{"America/Phoenix"} US{"America/Phoenix"}
ZZ{"Etc/GMT+7"} ZZ{"Etc/GMT+7"}
} }
"UTC"{ "UTC"{
001{"Etc/GMT"} 001{"Etc/UTC"}
GL{"America/Danmarkshavn"} ZZ{"Etc/UTC Etc/GMT"}
ZZ{"Etc/GMT Etc/UTC"}
} }
"UTC+12"{ "UTC+12"{
001{"Etc/GMT-12"} 001{"Etc/GMT-12"}
@ -812,10 +816,7 @@ windowsZones:table(nofallback){
} }
"Yukon Standard Time"{ "Yukon Standard Time"{
001{"America/Whitehorse"} 001{"America/Whitehorse"}
CA{ CA{"America/Whitehorse America/Dawson"}
"America/Whitehorse America/Creston America/Dawson America/Dawson_Cre"
"ek America/Fort_Nelson"
}
} }
} }
} }

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
// Generated by make_intl_data.py. DO NOT EDIT. // Generated by make_intl_data.py. DO NOT EDIT.
// tzdata version = 2021a // tzdata version = 2022e
#ifndef builtin_IntlTimeZoneData_h #ifndef builtin_IntlTimeZoneData_h
#define builtin_IntlTimeZoneData_h #define builtin_IntlTimeZoneData_h
@ -18,7 +18,7 @@ const char* const ianaZonesTreatedAsLinksByICU[] = {
"America/Argentina/Cordoba", // America/Cordoba [southamerica] "America/Argentina/Cordoba", // America/Cordoba [southamerica]
"America/Argentina/Jujuy", // America/Jujuy [southamerica] "America/Argentina/Jujuy", // America/Jujuy [southamerica]
"America/Argentina/Mendoza", // America/Mendoza [southamerica] "America/Argentina/Mendoza", // America/Mendoza [southamerica]
"America/Atikokan", // America/Coral_Harbour [northamerica] "America/Atikokan", // America/Coral_Harbour [backzone]
"America/Ensenada", // America/Tijuana [backzone] "America/Ensenada", // America/Tijuana [backzone]
"America/Indiana/Indianapolis", // America/Indianapolis [northamerica] "America/Indiana/Indianapolis", // America/Indianapolis [northamerica]
"America/Kentucky/Louisville", // America/Louisville [northamerica] "America/Kentucky/Louisville", // America/Louisville [northamerica]
@ -36,11 +36,13 @@ const char* const ianaZonesTreatedAsLinksByICU[] = {
"Atlantic/Jan_Mayen", // Arctic/Longyearbyen [backzone] "Atlantic/Jan_Mayen", // Arctic/Longyearbyen [backzone]
"EST", // Etc/GMT+5 [northamerica] "EST", // Etc/GMT+5 [northamerica]
"Europe/Belfast", // Europe/London [backzone] "Europe/Belfast", // Europe/London [backzone]
"Europe/Kyiv", // Europe/Kiev [europe]
"Europe/Tiraspol", // Europe/Chisinau [backzone] "Europe/Tiraspol", // Europe/Chisinau [backzone]
"HST", // Etc/GMT+10 [northamerica] "HST", // Etc/GMT+10 [northamerica]
"MST", // Etc/GMT+7 [northamerica] "MST", // Etc/GMT+7 [northamerica]
"Pacific/Chuuk", // Pacific/Truk [australasia] "Pacific/Chuuk", // Pacific/Truk [backzone]
"Pacific/Pohnpei", // Pacific/Ponape [australasia] "Pacific/Kanton", // Pacific/Enderbury [australasia]
"Pacific/Pohnpei", // Pacific/Ponape [backzone]
}; };
// Format: // Format:
@ -60,14 +62,13 @@ const LinkAndTarget ianaLinksCanonicalizedDifferentlyByICU[] = {
{ "America/Godthab", "America/Nuuk" }, // America/Godthab [backward] { "America/Godthab", "America/Nuuk" }, // America/Godthab [backward]
{ "America/Indianapolis", "America/Indiana/Indianapolis" }, // America/Indianapolis [backward] { "America/Indianapolis", "America/Indiana/Indianapolis" }, // America/Indianapolis [backward]
{ "America/Jujuy", "America/Argentina/Jujuy" }, // America/Jujuy [backward] { "America/Jujuy", "America/Argentina/Jujuy" }, // America/Jujuy [backward]
{ "America/Kralendijk", "America/Curacao" }, // America/Kralendijk [southamerica] { "America/Kralendijk", "America/Curacao" }, // America/Kralendijk [northamerica]
{ "America/Louisville", "America/Kentucky/Louisville" }, // America/Louisville [backward] { "America/Louisville", "America/Kentucky/Louisville" }, // America/Louisville [backward]
{ "America/Lower_Princes", "America/Curacao" }, // America/Lower_Princes [southamerica] { "America/Lower_Princes", "America/Curacao" }, // America/Lower_Princes [northamerica]
{ "America/Marigot", "America/Port_of_Spain" }, // America/Marigot [southamerica] { "America/Marigot", "America/Port_of_Spain" }, // America/Marigot [northamerica]
{ "America/Mendoza", "America/Argentina/Mendoza" }, // America/Mendoza [backward] { "America/Mendoza", "America/Argentina/Mendoza" }, // America/Mendoza [backward]
{ "America/Santa_Isabel", "America/Tijuana" }, // America/Santa_Isabel [backward] { "America/Santa_Isabel", "America/Tijuana" }, // America/Santa_Isabel [backward]
{ "America/St_Barthelemy", "America/Port_of_Spain" }, // America/St_Barthelemy [southamerica] { "America/St_Barthelemy", "America/Port_of_Spain" }, // America/St_Barthelemy [northamerica]
{ "America/Virgin", "America/Port_of_Spain" }, // America/St_Thomas [backward]
{ "Antarctica/South_Pole", "Antarctica/McMurdo" }, // Pacific/Auckland [backward] { "Antarctica/South_Pole", "Antarctica/McMurdo" }, // Pacific/Auckland [backward]
{ "Arctic/Longyearbyen", "Europe/Oslo" }, // Arctic/Longyearbyen [europe] { "Arctic/Longyearbyen", "Europe/Oslo" }, // Arctic/Longyearbyen [europe]
{ "Asia/Calcutta", "Asia/Kolkata" }, // Asia/Calcutta [backward] { "Asia/Calcutta", "Asia/Kolkata" }, // Asia/Calcutta [backward]
@ -78,6 +79,7 @@ const LinkAndTarget ianaLinksCanonicalizedDifferentlyByICU[] = {
{ "Atlantic/Faeroe", "Atlantic/Faroe" }, // Atlantic/Faeroe [backward] { "Atlantic/Faeroe", "Atlantic/Faroe" }, // Atlantic/Faeroe [backward]
{ "Europe/Bratislava", "Europe/Prague" }, // Europe/Bratislava [europe] { "Europe/Bratislava", "Europe/Prague" }, // Europe/Bratislava [europe]
{ "Europe/Busingen", "Europe/Zurich" }, // Europe/Busingen [europe] { "Europe/Busingen", "Europe/Zurich" }, // Europe/Busingen [europe]
{ "Europe/Kiev", "Europe/Kyiv" }, // Europe/Kiev [backward]
{ "Europe/Mariehamn", "Europe/Helsinki" }, // Europe/Mariehamn [europe] { "Europe/Mariehamn", "Europe/Helsinki" }, // Europe/Mariehamn [europe]
{ "Europe/Podgorica", "Europe/Belgrade" }, // Europe/Podgorica [europe] { "Europe/Podgorica", "Europe/Belgrade" }, // Europe/Podgorica [europe]
{ "Europe/San_Marino", "Europe/Rome" }, // Europe/San_Marino [europe] { "Europe/San_Marino", "Europe/Rome" }, // Europe/San_Marino [europe]
@ -106,6 +108,8 @@ const char* const legacyICUTimeZones[] = {
"Canada/East-Saskatchewan", "Canada/East-Saskatchewan",
"EAT", "EAT",
"ECT", "ECT",
"Eire--ICU",
"Europe/Bratislava--ICU",
"IET", "IET",
"IST", "IST",
"JST", "JST",
@ -118,6 +122,9 @@ const char* const legacyICUTimeZones[] = {
"PST", "PST",
"SST", "SST",
"VST", "VST",
"Africa/Windhoek--ICU",
"Europe/Dublin--ICU",
"Europe/Prague--ICU",
"SystemV/AST4", "SystemV/AST4",
"SystemV/AST4ADT", "SystemV/AST4ADT",
"SystemV/CST6", "SystemV/CST6",

View file

@ -1,7 +1,7 @@
// |reftest| skip-if(!this.hasOwnProperty("Intl")) // |reftest| skip-if(!this.hasOwnProperty("Intl"))
// Generated by make_intl_data.py. DO NOT EDIT. // Generated by make_intl_data.py. DO NOT EDIT.
// tzdata version = 2021a // tzdata version = 2022e
const tzMapper = [ const tzMapper = [
x => x, x => x,
@ -26,7 +26,7 @@ const links = {
"America/Porto_Acre": "America/Rio_Branco", "America/Porto_Acre": "America/Rio_Branco",
"America/Santa_Isabel": "America/Tijuana", "America/Santa_Isabel": "America/Tijuana",
"America/Shiprock": "America/Denver", "America/Shiprock": "America/Denver",
"America/Virgin": "America/Port_of_Spain", "America/Virgin": "America/St_Thomas",
"Antarctica/South_Pole": "Antarctica/McMurdo", "Antarctica/South_Pole": "Antarctica/McMurdo",
"Asia/Ashkhabad": "Asia/Ashgabat", "Asia/Ashkhabad": "Asia/Ashgabat",
"Asia/Calcutta": "Asia/Kolkata", "Asia/Calcutta": "Asia/Kolkata",
@ -69,6 +69,7 @@ const links = {
"Egypt": "Africa/Cairo", "Egypt": "Africa/Cairo",
"Eire": "Europe/Dublin", "Eire": "Europe/Dublin",
"Etc/UCT": "Etc/UTC", "Etc/UCT": "Etc/UTC",
"Europe/Kiev": "Europe/Kyiv",
"GB": "Europe/London", "GB": "Europe/London",
"GB-Eire": "Europe/London", "GB-Eire": "Europe/London",
"GMT+0": "Etc/GMT", "GMT+0": "Etc/GMT",
@ -112,6 +113,7 @@ const links = {
"US/Michigan": "America/Detroit", "US/Michigan": "America/Detroit",
"US/Mountain": "America/Denver", "US/Mountain": "America/Denver",
"US/Pacific": "America/Los_Angeles", "US/Pacific": "America/Los_Angeles",
"US/Pacific-New": "America/Los_Angeles",
"US/Samoa": "Pacific/Pago_Pago", "US/Samoa": "Pacific/Pago_Pago",
"UTC": "Etc/UTC", "UTC": "Etc/UTC",
"Universal": "Etc/UTC", "Universal": "Etc/UTC",

View file

@ -1,7 +1,7 @@
// |reftest| skip-if(!this.hasOwnProperty("Intl")) // |reftest| skip-if(!this.hasOwnProperty("Intl"))
// Generated by make_intl_data.py. DO NOT EDIT. // Generated by make_intl_data.py. DO NOT EDIT.
// tzdata version = 2021a // tzdata version = 2022e
const tzMapper = [ const tzMapper = [
x => x, x => x,
@ -15,6 +15,7 @@ const tzMapper = [
// Backzone zones derived from IANA Time Zone Database. // Backzone zones derived from IANA Time Zone Database.
const links = { const links = {
"Africa/Accra": "Africa/Accra",
"Africa/Addis_Ababa": "Africa/Addis_Ababa", "Africa/Addis_Ababa": "Africa/Addis_Ababa",
"Africa/Asmara": "Africa/Asmara", "Africa/Asmara": "Africa/Asmara",
"Africa/Bamako": "Africa/Bamako", "Africa/Bamako": "Africa/Bamako",
@ -52,50 +53,82 @@ const links = {
"America/Antigua": "America/Antigua", "America/Antigua": "America/Antigua",
"America/Argentina/ComodRivadavia": "America/Argentina/ComodRivadavia", "America/Argentina/ComodRivadavia": "America/Argentina/ComodRivadavia",
"America/Aruba": "America/Aruba", "America/Aruba": "America/Aruba",
"America/Atikokan": "America/Atikokan",
"America/Blanc-Sablon": "America/Blanc-Sablon",
"America/Cayman": "America/Cayman", "America/Cayman": "America/Cayman",
"America/Coral_Harbour": "America/Coral_Harbour", "America/Coral_Harbour": "America/Coral_Harbour",
"America/Creston": "America/Creston",
"America/Curacao": "America/Curacao",
"America/Dominica": "America/Dominica", "America/Dominica": "America/Dominica",
"America/Ensenada": "America/Ensenada", "America/Ensenada": "America/Ensenada",
"America/Grenada": "America/Grenada", "America/Grenada": "America/Grenada",
"America/Guadeloupe": "America/Guadeloupe", "America/Guadeloupe": "America/Guadeloupe",
"America/Montreal": "America/Montreal", "America/Montreal": "America/Montreal",
"America/Montserrat": "America/Montserrat", "America/Montserrat": "America/Montserrat",
"America/Nassau": "America/Nassau",
"America/Port_of_Spain": "America/Port_of_Spain",
"America/Rosario": "America/Rosario", "America/Rosario": "America/Rosario",
"America/St_Kitts": "America/St_Kitts", "America/St_Kitts": "America/St_Kitts",
"America/St_Lucia": "America/St_Lucia", "America/St_Lucia": "America/St_Lucia",
"America/St_Thomas": "America/St_Thomas", "America/St_Thomas": "America/St_Thomas",
"America/St_Vincent": "America/St_Vincent", "America/St_Vincent": "America/St_Vincent",
"America/Tortola": "America/Tortola", "America/Tortola": "America/Tortola",
"Antarctica/DumontDUrville": "Antarctica/DumontDUrville",
"Antarctica/McMurdo": "Antarctica/McMurdo", "Antarctica/McMurdo": "Antarctica/McMurdo",
"Antarctica/Syowa": "Antarctica/Syowa",
"Antarctica/Vostok": "Antarctica/Vostok",
"Asia/Aden": "Asia/Aden", "Asia/Aden": "Asia/Aden",
"Asia/Bahrain": "Asia/Bahrain", "Asia/Bahrain": "Asia/Bahrain",
"Asia/Brunei": "Asia/Brunei",
"Asia/Chongqing": "Asia/Chongqing", "Asia/Chongqing": "Asia/Chongqing",
"Asia/Harbin": "Asia/Harbin", "Asia/Harbin": "Asia/Harbin",
"Asia/Kashgar": "Asia/Kashgar", "Asia/Kashgar": "Asia/Kashgar",
"Asia/Kuala_Lumpur": "Asia/Kuala_Lumpur",
"Asia/Kuwait": "Asia/Kuwait", "Asia/Kuwait": "Asia/Kuwait",
"Asia/Muscat": "Asia/Muscat", "Asia/Muscat": "Asia/Muscat",
"Asia/Phnom_Penh": "Asia/Phnom_Penh", "Asia/Phnom_Penh": "Asia/Phnom_Penh",
"Asia/Tel_Aviv": "Asia/Tel_Aviv", "Asia/Tel_Aviv": "Asia/Tel_Aviv",
"Asia/Vientiane": "Asia/Vientiane", "Asia/Vientiane": "Asia/Vientiane",
"Atlantic/Jan_Mayen": "Atlantic/Jan_Mayen", "Atlantic/Jan_Mayen": "Atlantic/Jan_Mayen",
"Atlantic/Reykjavik": "Atlantic/Reykjavik",
"Atlantic/St_Helena": "Atlantic/St_Helena", "Atlantic/St_Helena": "Atlantic/St_Helena",
"Australia/Currie": "Australia/Currie", "Australia/Currie": "Australia/Currie",
"Europe/Amsterdam": "Europe/Amsterdam",
"Europe/Belfast": "Europe/Belfast", "Europe/Belfast": "Europe/Belfast",
"Europe/Copenhagen": "Europe/Copenhagen",
"Europe/Guernsey": "Europe/Guernsey", "Europe/Guernsey": "Europe/Guernsey",
"Europe/Isle_of_Man": "Europe/Isle_of_Man", "Europe/Isle_of_Man": "Europe/Isle_of_Man",
"Europe/Jersey": "Europe/Jersey", "Europe/Jersey": "Europe/Jersey",
"Europe/Ljubljana": "Europe/Ljubljana", "Europe/Ljubljana": "Europe/Ljubljana",
"Europe/Luxembourg": "Europe/Luxembourg",
"Europe/Monaco": "Europe/Monaco",
"Europe/Oslo": "Europe/Oslo",
"Europe/Sarajevo": "Europe/Sarajevo", "Europe/Sarajevo": "Europe/Sarajevo",
"Europe/Skopje": "Europe/Skopje", "Europe/Skopje": "Europe/Skopje",
"Europe/Stockholm": "Europe/Stockholm",
"Europe/Tiraspol": "Europe/Tiraspol", "Europe/Tiraspol": "Europe/Tiraspol",
"Europe/Uzhgorod": "Europe/Uzhgorod",
"Europe/Vaduz": "Europe/Vaduz", "Europe/Vaduz": "Europe/Vaduz",
"Europe/Zagreb": "Europe/Zagreb", "Europe/Zagreb": "Europe/Zagreb",
"Europe/Zaporozhye": "Europe/Zaporozhye",
"Indian/Antananarivo": "Indian/Antananarivo", "Indian/Antananarivo": "Indian/Antananarivo",
"Indian/Christmas": "Indian/Christmas",
"Indian/Cocos": "Indian/Cocos",
"Indian/Comoro": "Indian/Comoro", "Indian/Comoro": "Indian/Comoro",
"Indian/Kerguelen": "Indian/Kerguelen",
"Indian/Mahe": "Indian/Mahe",
"Indian/Mayotte": "Indian/Mayotte", "Indian/Mayotte": "Indian/Mayotte",
"Indian/Reunion": "Indian/Reunion",
"Pacific/Chuuk": "Pacific/Chuuk",
"Pacific/Enderbury": "Pacific/Enderbury",
"Pacific/Funafuti": "Pacific/Funafuti",
"Pacific/Johnston": "Pacific/Johnston", "Pacific/Johnston": "Pacific/Johnston",
"Pacific/Majuro": "Pacific/Majuro",
"Pacific/Midway": "Pacific/Midway", "Pacific/Midway": "Pacific/Midway",
"Pacific/Pohnpei": "Pacific/Pohnpei",
"Pacific/Saipan": "Pacific/Saipan", "Pacific/Saipan": "Pacific/Saipan",
"Pacific/Wake": "Pacific/Wake",
"Pacific/Wallis": "Pacific/Wallis",
}; };
for (let [linkName, target] of Object.entries(links)) { for (let [linkName, target] of Object.entries(links)) {

View file

@ -1,7 +1,7 @@
// |reftest| skip-if(!this.hasOwnProperty("Intl")) // |reftest| skip-if(!this.hasOwnProperty("Intl"))
// Generated by make_intl_data.py. DO NOT EDIT. // Generated by make_intl_data.py. DO NOT EDIT.
// tzdata version = 2021a // tzdata version = 2022e
const tzMapper = [ const tzMapper = [
x => x, x => x,
@ -17,8 +17,18 @@ const tzMapper = [
// Backzone links derived from IANA Time Zone Database. // Backzone links derived from IANA Time Zone Database.
const links = { const links = {
"Africa/Asmera": "Africa/Asmara", "Africa/Asmera": "Africa/Asmara",
"America/Kralendijk": "America/Curacao",
"America/Lower_Princes": "America/Curacao",
"America/Marigot": "America/Port_of_Spain",
"America/St_Barthelemy": "America/Port_of_Spain",
"America/Virgin": "America/St_Thomas",
"Antarctica/South_Pole": "Antarctica/McMurdo", "Antarctica/South_Pole": "Antarctica/McMurdo",
"Arctic/Longyearbyen": "Europe/Oslo",
"Asia/Chungking": "Asia/Chongqing", "Asia/Chungking": "Asia/Chongqing",
"Iceland": "Atlantic/Reykjavik",
"Pacific/Ponape": "Pacific/Pohnpei",
"Pacific/Truk": "Pacific/Chuuk",
"Pacific/Yap": "Pacific/Chuuk",
}; };
for (let [linkName, target] of Object.entries(links)) { for (let [linkName, target] of Object.entries(links)) {

View file

@ -1,7 +1,7 @@
// |reftest| skip-if(!this.hasOwnProperty("Intl")) // |reftest| skip-if(!this.hasOwnProperty("Intl"))
// Generated by make_intl_data.py. DO NOT EDIT. // Generated by make_intl_data.py. DO NOT EDIT.
// tzdata version = 2021a // tzdata version = 2022e
const tzMapper = [ const tzMapper = [
x => x, x => x,
@ -31,7 +31,6 @@ const links = {
"Europe/San_Marino": "Europe/Rome", "Europe/San_Marino": "Europe/Rome",
"Europe/Vatican": "Europe/Rome", "Europe/Vatican": "Europe/Rome",
"GMT": "Etc/GMT", "GMT": "Etc/GMT",
"US/Pacific-New": "America/Los_Angeles",
}; };
for (let [linkName, target] of Object.entries(links)) { for (let [linkName, target] of Object.entries(links)) {

View file

@ -1169,7 +1169,8 @@ nsCORSPreflightListener::AddResultToCache(nsIRequest *aRequest)
} }
uint32_t i; uint32_t i;
for (i = 0; i < entry->mMethods.Length(); ++i) { for (i = 0; i < entry->mMethods.Length(); ++i) {
if (entry->mMethods[i].token.Equals(method)) { if ((entry->mMethods[i].token.EqualsLiteral("*") && !mWithCredentials) ||
entry->mMethods[i].token.Equals(method)) {
entry->mMethods[i].expirationTime = expirationTime; entry->mMethods[i].expirationTime = expirationTime;
break; break;
} }
@ -1199,7 +1200,8 @@ nsCORSPreflightListener::AddResultToCache(nsIRequest *aRequest)
} }
uint32_t i; uint32_t i;
for (i = 0; i < entry->mHeaders.Length(); ++i) { for (i = 0; i < entry->mHeaders.Length(); ++i) {
if (entry->mHeaders[i].token.Equals(header)) { if ((entry->mHeaders[i].token.EqualsLiteral("*") && !mWithCredentials) ||
entry->mHeaders[i].token.Equals(header)) {
entry->mHeaders[i].expirationTime = expirationTime; entry->mHeaders[i].expirationTime = expirationTime;
break; break;
} }
@ -1325,7 +1327,11 @@ nsCORSPreflightListener::CheckPreflightRequestApproved(nsIRequest* aRequest)
NS_ConvertUTF8toUTF16(method).get()); NS_ConvertUTF8toUTF16(method).get());
return NS_ERROR_DOM_BAD_URI; return NS_ERROR_DOM_BAD_URI;
} }
foundMethod |= mPreflightMethod.Equals(method); if (method.EqualsLiteral("*") && !mWithCredentials) {
foundMethod = true;
} else {
foundMethod |= mPreflightMethod.Equals(method);
}
} }
if (!foundMethod) { if (!foundMethod) {
LogBlockedRequest(aRequest, "CORSMethodNotFound", nullptr); LogBlockedRequest(aRequest, "CORSMethodNotFound", nullptr);
@ -1338,6 +1344,7 @@ nsCORSPreflightListener::CheckPreflightRequestApproved(nsIRequest* aRequest)
headerVal); headerVal);
nsTArray<nsCString> headers; nsTArray<nsCString> headers;
nsCCharSeparatedTokenizer headerTokens(headerVal, ','); nsCCharSeparatedTokenizer headerTokens(headerVal, ',');
bool allowAllHeaders = false;
while(headerTokens.hasMoreTokens()) { while(headerTokens.hasMoreTokens()) {
const nsDependentCSubstring& header = headerTokens.nextToken(); const nsDependentCSubstring& header = headerTokens.nextToken();
if (header.IsEmpty()) { if (header.IsEmpty()) {
@ -1348,14 +1355,20 @@ nsCORSPreflightListener::CheckPreflightRequestApproved(nsIRequest* aRequest)
NS_ConvertUTF8toUTF16(header).get()); NS_ConvertUTF8toUTF16(header).get());
return NS_ERROR_DOM_BAD_URI; return NS_ERROR_DOM_BAD_URI;
} }
headers.AppendElement(header); if (header.EqualsLiteral("*") && !mWithCredentials) {
allowAllHeaders = true;
} else {
headers.AppendElement(header);
}
} }
for (uint32_t i = 0; i < mPreflightHeaders.Length(); ++i) { if (!allowAllHeaders) {
if (!headers.Contains(mPreflightHeaders[i], for (uint32_t i = 0; i < mPreflightHeaders.Length(); ++i) {
nsCaseInsensitiveCStringArrayComparator())) { if (!headers.Contains(mPreflightHeaders[i],
LogBlockedRequest(aRequest, "CORSMissingAllowHeaderFromPreflight", nsCaseInsensitiveCStringArrayComparator())) {
NS_ConvertUTF8toUTF16(mPreflightHeaders[i]).get()); LogBlockedRequest(aRequest, "CORSMissingAllowHeaderFromPreflight",
return NS_ERROR_DOM_BAD_URI; NS_ConvertUTF8toUTF16(mPreflightHeaders[i]).get());
return NS_ERROR_DOM_BAD_URI;
}
} }
} }