summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2022-02-08 23:39:30 -0800
committerLinus Groh <mail@linusgroh.de>2022-02-09 14:05:07 +0000
commit2e81990a3c3fc3a0d6da56d801d082240c1ccf2f (patch)
tree591ba4c1da849bdfebd7e7425ae146850bdddf53 /Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp
parent72e0d3d20b3ad6ff275ca511c15960d1376c160a (diff)
downloadserenity-2e81990a3c3fc3a0d6da56d801d082240c1ccf2f.zip
LibWeb: Do not set Content-Length headers twice for POST requests
While trying to get http://lite.duckduckgo.com to work in the Browser I noticed that we kept on getting 400 (Bad Request) errors when you click the "Search" button for a request. After turning on `JOB_DEBUG` to see what headers we were sending it turned out that we were actually setting `Content-Length` twice once in LibWeb, and again when the request is handled by LibHTTP. Since LibHTTP transparently handles this now, we can avoid it in LibWeb.
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp')
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp
index 3dac65925f..db8d71abc3 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp
@@ -117,7 +117,6 @@ void HTMLFormElement::submit_form(RefPtr<HTMLElement> submitter, bool from_submi
auto body = url_encode(parameters, AK::URL::PercentEncodeSet::ApplicationXWWWFormUrlencoded).to_byte_buffer();
request.set_method("POST");
request.set_header("Content-Type", "application/x-www-form-urlencoded");
- request.set_header("Content-Length", String::number(body.size()));
request.set_body(body);
}