[undertow-dev] ResourceHandler give 0 byte Content-Length for HEAD

Jason Greene jason.greene at redhat.com
Fri Mar 13 15:55:39 EDT 2015


> On Mar 13, 2015, at 2:47 PM, Bernd Eckenfels <ecki at zusammenkunft.net> wrote:
> 
> Hello,
> 
> with all versions I tried (including 1.2.0.Beta9) undertow-core will
> return content-length: 0 if a HEAD request is made.
> 

-snip-

> < HTTP/1.1 200 OK
> < Connection: keep-alive
> < Last-Modified: Fri, 13 Mar 2015 19:24:58 GMT
> < Content-Length: 0
> < Content-Type: text/xml
> < Date: Fri, 13 Mar 2015 19:40:51 GMT
> <
> * Connection #0 to host localhost left intact
> 
> According to RFC2616 sc 14.13 this needs to be non-null.
> 

It’s wasting bandwidth, so we should probably not send it. However, its a legal value:

14.13 says "Any Content-Length greater than or equal to zero is a valid value."

--
Jason T. Greene
WildFly Lead / JBoss EAP Platform Architect
JBoss, a division of Red Hat




More information about the undertow-dev mailing list