RFC 2616 Compliance : HTTP Get with message body
Added by morti almost 14 years ago
Hi,
Lighttpd refuse any HTTP Get request that contains message-header Content-Length.
lighttpd 1.4.26: request.c +1123
switch(con->request.http_method) { case HTTP_METHOD_GET: case HTTP_METHOD_HEAD: /* content-length is forbidden for those */ if (con_length_set && con->request.content_length != 0) { /* content-length is missing */ log_error_write(srv, __FILE__, __LINE__, "s", "GET/HEAD with content-length -> 400"); con->keep_alive = 0; con->http_status = 400; return 0; } break;
RFC 2616 Section 4.3 Specifies:
The presence of a message-body in a request is signaled by the inclusion of a Content-Length or Transfer-Encoding header field in the request's message-headers. A message-body MUST NOT be included in a request if the specification of the request method (section 5.1.1) does not allow sending an entity-body in requests.
However, this RFC doesn't forbid the presence of a message-body in a HTTP Get request.
Jeff Mogul, one of the authors listed on the HTTP/1.1 specification, also doesn't know for sure about a GET request with a body ( http://lists.w3.org/Archives/Public/ietf-http-wg/2006AprJun/0103.html ) So apparently the specs didn't cover this part.
According to my tests, Apache httpd seems to support it.
Is there any reason why lighttpd doesn't support sending body using a GET request ?
Thanks
Morti.
Replies (3)
RE: RFC 2616 Compliance : HTTP Get with message body - Added by lonnyk almost 14 years ago
It might be better to open up a bug report.
RE: RFC 2616 Compliance : HTTP Get with message body - Added by stbuehler almost 14 years ago
We won't accept message bodies in HTTP get.
RE: RFC 2616 Compliance : HTTP Get with message body - Added by morti almost 14 years ago
Can I ask why ? Is it a design limitation ?
Thanks.
Morti.