mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
AK: Make URL ApplicationXWWWFormUrlencoded encoding closer to spec
It was mostly implemented based on a spec note, that described only allowed characters, but instead of allowing some special characters not to be escaped, we escaped every special character except those 'new in this encode set' disallowed characters from the spec definition.
This commit is contained in:
parent
9e69a89f8e
commit
65afa113e5
Notes:
sideshowbarker
2024-07-17 10:20:02 +09:00
Author: https://github.com/krkk Commit: https://github.com/SerenityOS/serenity/commit/65afa113e5 Pull-request: https://github.com/SerenityOS/serenity/pull/14252 Reviewed-by: https://github.com/linusg
1 changed files with 1 additions and 1 deletions
|
@ -402,7 +402,7 @@ bool URL::code_point_is_in_percent_encode_set(u32 code_point, URL::PercentEncode
|
|||
case URL::PercentEncodeSet::Component:
|
||||
return code_point_is_in_percent_encode_set(code_point, URL::PercentEncodeSet::Userinfo) || "$%&+,"sv.contains(code_point);
|
||||
case URL::PercentEncodeSet::ApplicationXWWWFormUrlencoded:
|
||||
return code_point >= 0x7E || !(is_ascii_alphanumeric(code_point) || "!'()~"sv.contains(code_point));
|
||||
return code_point_is_in_percent_encode_set(code_point, URL::PercentEncodeSet::Component) || "!'()~"sv.contains(code_point);
|
||||
case URL::PercentEncodeSet::EncodeURI:
|
||||
// NOTE: This is the same percent encode set that JS encodeURI() uses.
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI
|
||||
|
|
Loading…
Reference in a new issue