mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:37:44 +00:00
LibWeb/Fetch: Use parsed referrer's origin in Request::construct_impl
This commit is contained in:
parent
94b247ec3c
commit
3151099b21
1 changed files with 2 additions and 2 deletions
|
@ -307,8 +307,8 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Request>> Request::construct_impl(JS::Realm
|
||||||
// - parsedReferrer’s scheme is "about" and path is the string "client"
|
// - parsedReferrer’s scheme is "about" and path is the string "client"
|
||||||
// - parsedReferrer’s origin is not same origin with origin
|
// - parsedReferrer’s origin is not same origin with origin
|
||||||
// then set request’s referrer to "client".
|
// then set request’s referrer to "client".
|
||||||
// FIXME: Actually use the given origin once we have https://url.spec.whatwg.org/#concept-url-origin.
|
auto parsed_referrer_origin = URL::url_origin(parsed_referrer);
|
||||||
if ((parsed_referrer.scheme() == "about"sv && parsed_referrer.serialize_path() == "client"sv) || !HTML::Origin().is_same_origin(origin)) {
|
if ((parsed_referrer.scheme() == "about"sv && parsed_referrer.serialize_path() == "client"sv) || !parsed_referrer_origin.is_same_origin(origin)) {
|
||||||
request->set_referrer(Infrastructure::Request::Referrer::Client);
|
request->set_referrer(Infrastructure::Request::Referrer::Client);
|
||||||
}
|
}
|
||||||
// 4. Otherwise, set request’s referrer to parsedReferrer.
|
// 4. Otherwise, set request’s referrer to parsedReferrer.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue