Bug 60663 - Sends "411 Content Length Required" reply to OPTIONS request with empty body
Summary: Sends "411 Content Length Required" reply to OPTIONS request with empty body
Status: NEEDINFO
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_http2 (show other bugs)
Version: 2.4.25
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-30 11:39 UTC by Jelmer Vernooij
Modified: 2018-04-28 11:24 UTC (History)
2 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jelmer Vernooij 2017-01-30 11:39:42 UTC
When the h2 module is enabled and a client contacts Apache using HTTP/2, the server will send back a 411 error when the OPTIONS method is used without a body and without a Content-Length specified.

This is not the case for HTTP/1.1, and accessing the same resource over HTTP/1.1 works fine.

https://tools.ietf.org/html/rfc7230#section-3.3.2 specifies that:

   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.

(SHOULD, not MUST)
Comment 1 Stefan Eissing 2018-04-28 11:24:03 UTC
Sorry for the late reply. Using curl, all seems fine:

curl -i --insecure -X OPTIONS https://test.example.org:12346/
HTTP/2 200 
date: Sat, 28 Apr 2018 11:22:38 GMT
server: Apache/2.5.1-dev (Unix) OpenSSL/1.0.2o
allow: POST,OPTIONS,HEAD,GET,TRACE
content-length: 0
content-type: httpd/unix-directory

Do you have any more information on how to generate the request? A server log with 

LogLevel http2:trace2

might also help. Thanks!