From 2d57d47132a30b2532c1cceb397c8a396708742e Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sun, 25 Sep 2022 19:28:48 +0100 Subject: [PATCH] LibWeb: Make Fetch::Infrastructure::Request::m_method default to "GET" ByteBuffer has an inline capacity of 32 bytes, so this isn't fallible and can be done inline. --- Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.h b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.h index 72c2232088..6a453123cc 100644 --- a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.h +++ b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.h @@ -296,7 +296,7 @@ public: private: // https://fetch.spec.whatwg.org/#concept-request-method // A request has an associated method (a method). Unless stated otherwise it is `GET`. - ByteBuffer m_method; + ByteBuffer m_method { ByteBuffer::copy("GET"sv.bytes()).release_value() }; // https://fetch.spec.whatwg.org/#local-urls-only-flag // A request has an associated local-URLs-only flag. Unless stated otherwise it is unset.