mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-31 21:59:21 +00:00
LibURL: Make percent_encode return a String
This simplifies a bunch of places which were needing to error check and convert from a ByteString to String.
This commit is contained in:
committed by
Andreas Kling
parent
c58665332e
commit
84a7fead0e
@@ -845,8 +845,7 @@ ErrorOr<void> HTMLFormElement::mail_as_body(URL::URL parsed_action, Vector<XHR::
|
||||
// 2. Set body to the result of running UTF-8 percent-encode on body using the default encode set. [URL]
|
||||
// NOTE: body is already UTF-8 encoded due to using AK::String, so we only have to do the percent encoding.
|
||||
// NOTE: "default encode set" links to "path percent-encode-set": https://url.spec.whatwg.org/#default-encode-set
|
||||
auto percent_encoded_body = URL::percent_encode(body, URL::PercentEncodeSet::Path);
|
||||
body = TRY(String::from_utf8(percent_encoded_body.view()));
|
||||
body = URL::percent_encode(body, URL::PercentEncodeSet::Path);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user