mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-06 02:55:49 +03:00
LibWeb/Fetch: Use parsed referrer's origin in Request::construct_impl
This commit is contained in:
parent
94b247ec3c
commit
3151099b21
Notes:
sideshowbarker
2024-07-17 21:16:31 +09:00
Author: https://github.com/kemzeb Commit: https://github.com/SerenityOS/serenity/commit/3151099b21 Pull-request: https://github.com/SerenityOS/serenity/pull/20797
@ -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 New Issue
Block a user