Hello All,<br><br>We have become aware of what seems to be two bugs in Hunchentoot svn head (stable version is unaffected).<br><br>The first one was discovered by, and should be credited to J.P. Larocque. The issue is that not only is Content-Range unnecessarily included in HTTP responses, but the upper value of the range is off by 1.<br>
<br>For example, look at these response headers:<br>< HTTP/1.1 200 OK<br>< Content-Length: 14260<br>< Content-Range: bytes 0-14260/*<br><br>J.P.'s analysis follows: <br>===============<br>Content-Range appears in response, but the status code is 200 rather<br>
than 206 (Partial Content). That's odd, but not illegal as far as I<br>can tell.<br><br>But the Content-Length is definitely inconsistent with the<br>Content-Range. HTTP 1.1 byte ranges are inclusive:<br><br>The last-byte-pos value gives the byte-offset of the last byte in<br>
the range; that is, the byte positions specified are inclusive. Byte<br>offsets start at zero.<br> -- HTTP 1.1 14.35.1 Byte Ranges<br> <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35">http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35</a><br>
<br>So a range of [0,14260] indicates a length of 14261 bytes, but that's<br>different from the Content-Length value.<br>===============<br><br>The second issue, which was our own discovery, is that the content-type will be incorrect when serving a 304 (Not Modified) response. <br>
<br>The content-type issue can be reproduced in Chrome/Chromium with the developer tools enabled. Basically, request some page while viewing the network tab. When you hit refresh (triggering status 304 instead of first visit 200), you will see the content type will be incorrect for images, javascript, or any other non-html.<br>
<br>The content-type issue seems to be caused by a change to the order of operations within handle-static-file of misc.lisp. The content type needs to be set before before calling handle-if-modified-since, which could otherwise abort before the proper content type is set.<br>
<br>Both of these issues can be fixed by reverting to an earlier version of misc.lisp. As we already mentioned, the stable version of Hunchentoot is not affected.<br><br>Thanks,<br>The Team at Wukix, Inc.<br><br>