mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 04:13:11 +00:00
LibWeb/Fetch: Use parsed referrer's origin in Request::construct_impl
This commit is contained in:
parent
94b247ec3c
commit
3151099b21
|
@ -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 origin is not same origin with origin
|
||||
// then set request’s referrer to "client".
|
||||
// FIXME: Actually use the given origin once we have https://url.spec.whatwg.org/#concept-url-origin.
|
||||
if ((parsed_referrer.scheme() == "about"sv && parsed_referrer.serialize_path() == "client"sv) || !HTML::Origin().is_same_origin(origin)) {
|
||||
auto parsed_referrer_origin = URL::url_origin(parsed_referrer);
|
||||
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);
|
||||
}
|
||||
// 4. Otherwise, set request’s referrer to parsedReferrer.
|
||||
|
|
Loading…
Reference in a new issue