1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 20:28:11 +00:00

AK: Port percent_encode_after_encoding to String

This commit is contained in:
Shannon Booth 2023-08-14 18:49:23 +12:00 committed by Andrew Kaster
parent cb4c279e90
commit 50d8ef94ba
3 changed files with 7 additions and 7 deletions

View file

@ -53,11 +53,11 @@ ErrorOr<String> url_encode(Vector<QueryParam> const& tuples, StringView encoding
// 2. Let name be the result of running percent-encode after encoding with encoding, tuples name, the application/x-www-form-urlencoded percent-encode set, and true.
// FIXME: URLParser does not currently implement encoding.
auto name = AK::URLParser::percent_encode_after_encoding(tuple.name, AK::URL::PercentEncodeSet::ApplicationXWWWFormUrlencoded, true);
auto name = TRY(URLParser::percent_encode_after_encoding(tuple.name, AK::URL::PercentEncodeSet::ApplicationXWWWFormUrlencoded, true));
// 3. Let value be the result of running percent-encode after encoding with encoding, tuples value, the application/x-www-form-urlencoded percent-encode set, and true.
// FIXME: URLParser does not currently implement encoding.
auto value = AK::URLParser::percent_encode_after_encoding(tuple.value, AK::URL::PercentEncodeSet::ApplicationXWWWFormUrlencoded, true);
auto value = TRY(URLParser::percent_encode_after_encoding(tuple.value, AK::URL::PercentEncodeSet::ApplicationXWWWFormUrlencoded, true));
// 4. If output is not the empty string, then append U+0026 (&) to output.
if (!output.is_empty())