mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 23:38:38 +09:00
Bug 1298823 - Fix Request constructor - with "mode: navigate"
This commit is contained in:
parent
98546534b0
commit
56c088c2d4
3 changed files with 17 additions and 33 deletions
|
|
@ -338,8 +338,7 @@ Request::Constructor(const GlobalObject& aGlobal,
|
|||
|
||||
if (mode == RequestMode::Navigate ||
|
||||
(aInit.IsAnyMemberPresent() && request->Mode() == RequestMode::Navigate)) {
|
||||
aRv.ThrowTypeError<MSG_INVALID_REQUEST_MODE>(NS_LITERAL_STRING("navigate"));
|
||||
return nullptr;
|
||||
mode = RequestMode::Same_origin;
|
||||
}
|
||||
|
||||
if (aInit.IsAnyMemberPresent()) {
|
||||
|
|
@ -374,11 +373,7 @@ Request::Constructor(const GlobalObject& aGlobal,
|
|||
nsresult rv = principal->CheckMayLoad(uri, /* report */ false,
|
||||
/* allowIfInheritsPrincipal */ false);
|
||||
if (NS_FAILED(rv)) {
|
||||
nsAutoCString globalOrigin;
|
||||
principal->GetOrigin(globalOrigin);
|
||||
aRv.ThrowTypeError<MSG_CROSS_ORIGIN_REFERRER_URL>(referrer,
|
||||
NS_ConvertUTF8toUTF16(globalOrigin));
|
||||
return nullptr;
|
||||
referrerURL.AssignLiteral(kFETCH_CLIENT_REFERRER_STR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -403,11 +398,10 @@ Request::Constructor(const GlobalObject& aGlobal,
|
|||
// this work in a single sync loop.
|
||||
RefPtr<ReferrerSameOriginChecker> checker =
|
||||
new ReferrerSameOriginChecker(worker, referrerURL, rv);
|
||||
checker->Dispatch(Terminating, aRv);
|
||||
if (aRv.Failed() || NS_FAILED(rv)) {
|
||||
aRv.ThrowTypeError<MSG_CROSS_ORIGIN_REFERRER_URL>(referrer,
|
||||
worker->GetLocationInfo().mOrigin);
|
||||
return nullptr;
|
||||
IgnoredErrorResult error;
|
||||
checker->Dispatch(Terminating, error);
|
||||
if (error.Failed() || NS_FAILED(rv)) {
|
||||
referrerURL.AssignLiteral(kFETCH_CLIENT_REFERRER_STR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue