1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

Always send Content-Length with POST, PUT, PATCH

This commit is contained in:
Matthew Atkinson 2014-11-05 08:38:55 +01:00 committed by Giuseppe Scrivano
parent 375b671f01
commit e0f149d29d
2 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2014-10-21 Matthew Atkinson <mutley456@ntlworld.com> (tiny change)
* http.c (gethttp): Always send Content-Length header when method is POST,
PUT, or PATCH even with no post body, as some servers will reject the
request otherwise.
2014-11-03 Jakub Čajka <jcajka@redhat.com>
* iri.c (remote_to_utf8): Fixed assumption that char is signed. Fixes

View File

@ -1874,6 +1874,10 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy,
xstrdup (number_to_static_string (body_data_size)),
rel_value);
}
else if (strcasecmp (opt.method, "post") == 0
|| strcasecmp (opt.method, "put") == 0
|| strcasecmp (opt.method, "patch") == 0)
request_set_header (req, "Content-Length", "0", rel_none);
}
retry_with_auth: