summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp
diff options
context:
space:
mode:
authorKenneth Myhra <kennethmyhra@gmail.com>2022-04-04 10:42:12 +0200
committerLinus Groh <mail@linusgroh.de>2022-04-23 18:05:55 +0200
commit1ca1a73d67ccd2ab795422acd40710fc494e76c1 (patch)
tree52e940caea0a5a1d76ece96d31f877e43033a702 /Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp
parentfccea8888e6d221916ace039fdc6af9604257046 (diff)
downloadserenity-1ca1a73d67ccd2ab795422acd40710fc494e76c1.zip
LibWeb: Trim leading and trailing HTTP whitespace bytes
The XMLHttpRequest specification specifices that header values should be normalized by trimming leading and trailing HTTP whitespace bytes.
Diffstat (limited to 'Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp')
-rw-r--r--Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp
index 314f12e2ff..5f5638f7dc 100644
--- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp
+++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp
@@ -406,8 +406,7 @@ static String normalize_method(String const& method)
// https://fetch.spec.whatwg.org/#concept-header-value-normalize
static String normalize_header_value(String const& header_value)
{
- // FIXME: I'm not sure if this is the right trim, it should only be HTML whitespace bytes.
- return header_value.trim_whitespace();
+ return header_value.trim(StringView { http_whitespace_bytes });
}
// https://xhr.spec.whatwg.org/#dom-xmlhttprequest-setrequestheader