mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-05-10 13:17:36 +00:00
LibURL+LibWeb: Do not percent decode in password/username getters
Doing it is not part of the spec. Whenever needed, the spec will explicitly percent decode the username and password. This fixes some URL WPT tests.
This commit is contained in:
committed by
Tim Ledbetter
parent
a10610a1ca
commit
f511c0b441
@@ -271,12 +271,12 @@ Optional<Header> HttpRequest::get_http_basic_authentication_header(URL::URL cons
|
||||
if (!url.includes_credentials())
|
||||
return {};
|
||||
StringBuilder builder;
|
||||
builder.append(url.username().release_value_but_fixme_should_propagate_errors());
|
||||
builder.append(URL::percent_decode(url.username()));
|
||||
builder.append(':');
|
||||
builder.append(url.password().release_value_but_fixme_should_propagate_errors());
|
||||
builder.append(URL::percent_decode(url.password()));
|
||||
|
||||
// FIXME: change to TRY() and make method fallible
|
||||
auto token = MUST(encode_base64(MUST(builder.to_string()).bytes()));
|
||||
auto token = MUST(encode_base64(builder.string_view().bytes()));
|
||||
builder.clear();
|
||||
builder.append("Basic "sv);
|
||||
builder.append(token);
|
||||
|
||||
Reference in New Issue
Block a user