From 7467307377dff637c514e10fee6fbded5f948fbb Mon Sep 17 00:00:00 2001 From: Luke Wilde Date: Sat, 14 Oct 2023 18:55:18 +0100 Subject: [PATCH] LibWeb: Use "POST" instead of "post" for POST resources in navigables HTTP methods are case sensitive and the Fetch layer treats it as such. For example, http_redirect_fetch case sensitively checks if the method is "POST" to change the method to "GET" and nullify the body. https://github.com/SerenityOS/serenity/blob/9d7e2175663eff6a00b176d4e1873b10836ee992/Userland/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp#L1125-L1135 Fixes https://github.com/SerenityOS/serenity/issues/21347 --- Userland/Libraries/LibWeb/HTML/Navigable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/HTML/Navigable.cpp b/Userland/Libraries/LibWeb/HTML/Navigable.cpp index b451231311..8788790f56 100644 --- a/Userland/Libraries/LibWeb/HTML/Navigable.cpp +++ b/Userland/Libraries/LibWeb/HTML/Navigable.cpp @@ -583,7 +583,7 @@ static WebIDL::ExceptionOr()) { // 1. Set request's method to `POST`. - request->set_method(TRY_OR_THROW_OOM(vm, ByteBuffer::copy("post"sv.bytes()))); + request->set_method(TRY_OR_THROW_OOM(vm, ByteBuffer::copy("POST"sv.bytes()))); // 2. Set request's body to documentResource's request body. request->set_body(document_resource.get().request_body.value());