mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:47:44 +00:00
AK+LibHTTP: Revert prior change to percent encode plus signs
A change was made prior to percent encode plus signs in order to fix an issue with the Google cookie consent page. Unforunately, this was treating a symptom of a problem and not the root cause and is incorrect behavior.
This commit is contained in:
parent
a2d89f11d1
commit
832920c003
3 changed files with 7 additions and 7 deletions
|
@ -395,19 +395,19 @@ constexpr bool code_point_is_in_percent_encode_set(u32 code_point, URL::PercentE
|
|||
}
|
||||
}
|
||||
|
||||
void URL::append_percent_encoded_if_necessary(StringBuilder& builder, u32 code_point, URL::PercentEncodeSet set, StringView reserved_chars)
|
||||
void URL::append_percent_encoded_if_necessary(StringBuilder& builder, u32 code_point, URL::PercentEncodeSet set)
|
||||
{
|
||||
if (code_point_is_in_percent_encode_set(code_point, set) || (!reserved_chars.is_null() && reserved_chars.contains(code_point)))
|
||||
if (code_point_is_in_percent_encode_set(code_point, set))
|
||||
append_percent_encoded(builder, code_point);
|
||||
else
|
||||
builder.append_code_point(code_point);
|
||||
}
|
||||
|
||||
String URL::percent_encode(StringView input, URL::PercentEncodeSet set, StringView reserved_chars)
|
||||
String URL::percent_encode(StringView input, URL::PercentEncodeSet set)
|
||||
{
|
||||
StringBuilder builder;
|
||||
for (auto code_point : Utf8View(input)) {
|
||||
append_percent_encoded_if_necessary(builder, code_point, set, reserved_chars);
|
||||
append_percent_encoded_if_necessary(builder, code_point, set);
|
||||
}
|
||||
return builder.to_string();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue