diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp index 2c8e783de2cb78..314f12e2ff6590 100644 --- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp +++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp @@ -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 regex { R"~~~(^.*["(),\/:;<=>?@\\[\]{}]+.*$)~~~" }; - return !regex.has_match(method); + Regex regex { R"~~~(^[A-Za-z0-9!#$%&'*+-.^_`|~]+$)~~~" }; + return regex.has_match(method); } // https://fetch.spec.whatwg.org/#concept-method-normalize