Hi Michael,

The HttpExchange implementation, sun.net.httpserver.ExchangeImpl, does not correctly handle HEAD requests. The test, described in the 'description section' of 6886723, invokes sendResponseHeaders with a 0 responseLength, i.e. chunked encoding. The "Transfer-encoding: chunked" header should be added to the response headers but no ChunkedOutputStream should be created. The current implementation does send an empty chunk causing subsequent requests on the same persistent connection to have problems.

The solution is to correctly set response headers, but create no corresponding OutputStreams when dealing with HEAD requests.

Webrev:
  http://cr.openjdk.java.net/~chegar/6886723/webrev.00/webrev/

Thanks,
-Chris

Reply via email to