[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-wget] Send Content-Length with POST 0 length body
From: |
Tim Rühsen |
Subject: |
Re: [Bug-wget] Send Content-Length with POST 0 length body |
Date: |
Mon, 20 Oct 2014 22:16:32 +0200 |
User-agent: |
KMail/4.14.1 (Linux/3.16-2-amd64; KDE/4.14.1; x86_64; ; ) |
Am Montag, 20. Oktober 2014, 20:08:05 schrieb Matthew Atkinson:
> On 20/10/14 16:26, Giuseppe Scrivano wrote:
> > should we do this only for POST requests? What about doing it in any
> > case that "!(opt.body_data || opt.body_file)"?
> >
> > Regards,
> > Giuseppe
>
> From http://tools.ietf.org/html/rfc7230#section-3.3.2
>
> > A user agent SHOULD send a Content-Length in a request message when
> > no Transfer-Encoding is sent and the request method defines a
> > meaning for an enclosed payload body. For example, a Content-Length
> > header field is normally sent in a POST request even when the value
> > is 0 (indicating an empty payload body). A user agent SHOULD
> > NOT send a Content-Length header field when the request message
> > does not contain a payload body and the method semantics do not
> > anticipate such a body.
>
> I would think that we should do this for POST and PUT, but nothing
> else
Since Wget does not explicitly support PUT, we may just care for the POST
request. Since servers may reject a POST without Content-Length, we are better
off with supplying one. Since PUT (and also PATCH) request 'anticipate' a body,
we could also care for these.
Matthew, could you also check for 'put and 'patch' request and send an amended
version of the patch. FYI, HTTP PATCH request is rfc5789.
RFC 7230
3.3.2. Content-Length
A user agent SHOULD send a Content-Length in a request message when
no Transfer-Encoding is sent and the request method defines a meaning
for an enclosed payload body. For example, a Content-Length header
field is normally sent in a POST request even when the value is 0
(indicating an empty payload body). A user agent SHOULD NOT send a
Content-Length header field when the request message does not contain
a payload body and the method semantics do not anticipate such a
body.
RFC7231
6.5.10. 411 Length Required
The 411 (Length Required) status code indicates that the server
refuses to accept the request without a defined Content-Length
(Section 3.3.2 of [RFC7230]). The client MAY repeat the request if
it adds a valid Content-Length header field containing the length of
the message body in the request message.
Tim
- [Bug-wget] Bug Track, Tushar, 2014/10/18
- Re: [Bug-wget] Bug Track, Tim Rühsen, 2014/10/19
- [Bug-wget] Send Content-Length with POST 0 length body, Matthew Atkinson, 2014/10/19
- Re: [Bug-wget] Send Content-Length with POST 0 length body, Tim Rühsen, 2014/10/19
- Re: [Bug-wget] Send Content-Length with POST 0 length body, Matthew Atkinson, 2014/10/20
- Re: [Bug-wget] Send Content-Length with POST 0 length body, Giuseppe Scrivano, 2014/10/20
- Re: [Bug-wget] Send Content-Length with POST 0 length body, Matthew Atkinson, 2014/10/20
- Re: [Bug-wget] Send Content-Length with POST 0 length body,
Tim Rühsen <=
- Re: [Bug-wget] Send Content-Length with POST 0 length body, Matthew Atkinson, 2014/10/21
- Re: [Bug-wget] Send Content-Length with POST 0 length body, Giuseppe Scrivano, 2014/10/21
- Re: [Bug-wget] Send Content-Length with POST 0 length body, Matthew Atkinson, 2014/10/23
- Re: [Bug-wget] Send Content-Length with POST 0 length body, Tim Rühsen, 2014/10/22