mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibWeb+LibURL: Use URL paths directly for comparison
This matches the text of the spec a little more closely in many cases and is also more efficient than serializing the URL path.
This commit is contained in:
parent
ea68bdef26
commit
ffe070d7f9
Notes:
github-actions[bot]
2024-08-05 07:59:07 +00:00
Author: https://github.com/shannonbooth
Commit: ffe070d7f9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/966
5 changed files with 9 additions and 11 deletions
|
@ -310,7 +310,8 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Request>> Request::construct_impl(JS::Realm
|
|||
// - parsedReferrer’s origin is not same origin with origin
|
||||
// then set request’s referrer to "client".
|
||||
auto parsed_referrer_origin = DOMURL::url_origin(parsed_referrer);
|
||||
if ((parsed_referrer.scheme() == "about"sv && parsed_referrer.serialize_path() == "client"sv) || !parsed_referrer_origin.is_same_origin(origin)) {
|
||||
if ((parsed_referrer.scheme() == "about"sv && parsed_referrer.paths().size() == 1 && parsed_referrer.paths()[0] == "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…
Add table
Add a link
Reference in a new issue