mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 23:09:08 +00: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
Notes:
sideshowbarker
2024-07-17 19:06:22 +09:00
Author: https://github.com/bgianfo
Commit: 2e81990a3c
Pull-request: https://github.com/SerenityOS/serenity/pull/12375
Reviewed-by: https://github.com/IdanHo ✅
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
Add a link
Reference in a new issue