LibWeb: Use a more restrictive regex for method token production
This changes the regular expression for is_method() to a more restrictive pattern.
This commit is contained in:
parent
053bcd4859
commit
fccea8888e
Notes:
sideshowbarker
2024-07-17 20:22:04 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/SerenityOS/serenity/commit/fccea8888e Pull-request: https://github.com/SerenityOS/serenity/pull/13520 Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/linusg ✅
1 changed files with 2 additions and 2 deletions
|
@ -390,8 +390,8 @@ static bool is_forbidden_method(String const& method)
|
|||
// https://fetch.spec.whatwg.org/#concept-method
|
||||
static bool is_method(String const& method)
|
||||
{
|
||||
Regex<ECMA262Parser> regex { R"~~~(^.*["(),\/:;<=>?@\\[\]{}]+.*$)~~~" };
|
||||
return !regex.has_match(method);
|
||||
Regex<ECMA262Parser> regex { R"~~~(^[A-Za-z0-9!#$%&'*+-.^_`|~]+$)~~~" };
|
||||
return regex.has_match(method);
|
||||
}
|
||||
|
||||
// https://fetch.spec.whatwg.org/#concept-method-normalize
|
||||
|
|
Loading…
Add table
Reference in a new issue