1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 01:27:42 +00:00

AK: Port URL username/password from DeprecatedString to String

And for cases that just need to check whether the password/username is
empty, add a raw_{password,username} helper to avoid any allocation.
This commit is contained in:
Shannon Booth 2023-08-12 16:52:38 +12:00 committed by Andrew Kaster
parent 6b29dc3e46
commit 55a01e72ca
11 changed files with 44 additions and 39 deletions

View file

@ -389,10 +389,10 @@ WebIDL::ExceptionOr<void> XMLHttpRequest::open(String const& method_string, Stri
if (!parsed_url.host().has<Empty>()) {
// 1. If the username argument is not null, set the username given parsedURL and username.
if (username.has_value())
parsed_url.set_username(username.value().to_deprecated_string());
MUST(parsed_url.set_username(username.value()));
// 2. If the password argument is not null, set the password given parsedURL and password.
if (password.has_value())
parsed_url.set_password(password.value().to_deprecated_string());
MUST(parsed_url.set_password(password.value()));
}
// 9. If async is false, the current global object is a Window object, and either thiss timeout is