Request for Review 6886723: light weight http server doesn't return correct status code for HEAD requests
chris.hegarty at oracle.com
Mon Apr 26 02:54:51 PDT 2010
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.
More information about the net-dev