mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 18:32:28 -05:00
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.
This commit is contained in:
parent
72e0d3d20b
commit
2e81990a3c
1 changed files with 0 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue