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:
Shannon Booth 2024-08-05 15:14:00 +12:00 committed by Andreas Kling
commit ffe070d7f9
Notes: github-actions[bot] 2024-08-05 07:59:07 +00:00
5 changed files with 9 additions and 11 deletions

View file

@ -799,7 +799,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> scheme_fetch(JS::Realm& r
// a body.
// NOTE: URLs such as "about:config" are handled during navigation and result in a network error in the context
// of fetching.
if (request->current_url().serialize_path() == "blank"sv) {
if (request->current_url().paths().size() == 1 && request->current_url().paths()[0] == "blank"sv) {
auto response = Infrastructure::Response::create(vm);
response->set_status_message(MUST(ByteBuffer::copy("OK"sv.bytes())));