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

Bernd Eckenfels ecki at zusammenkunft.net
Fri Mar 13 17:10:37 EDT 2015


Hello Jason,

oh ok, no problem. I was trying to fix it myself by adding a
content-length header in ResourceHandler#serveResource in the" if
(!sendContent)", but it seems the core is overwriting this.

Want me to open a bug for it?

Gruss
Bernd


 Am Fri, 13 Mar 2015 15:29:55 -0500
schrieb Jason Greene <jason.greene at redhat.com>:

> Ah! now i follow. Sorry, I skimmed your email and didn’t recognize
> you were highlighting the discrepancy between a GET and HEAD.
> 
> > On Mar 13, 2015, at 3:20 PM, Bernd Eckenfels
> > <ecki at zusammenkunft.net> wrote:
> > 
> > Hello Jason,
> > 
> > yes you could send a wrong value and it would be
> > better to not answer one than a wrong one, but even better woild it
> > be to follow the RFC recommendation, that states that the headers
> > of a HEAD should be identical to those of a GET. In fact the
> > content-length is one of the most interesting informations one
> > would want to query with a HEAD request.
> > 
> > Gruss
> > Bernd
> > 
> > Am Fri, 13 Mar 2015 14:55:39 -0500
> > schrieb Jason Greene <jason.greene at redhat.com>:
> > 
> >> 
> >>> 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
> >> 
> > 
> > 
> > _______________________________________________
> > undertow-dev mailing list
> > undertow-dev at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/undertow-dev
> 
> --
> Jason T. Greene
> WildFly Lead / JBoss EAP Platform Architect
> JBoss, a division of Red Hat
> 




More information about the undertow-dev mailing list