A HEAD request should never attempt to read any body data. If chunked encoding or a content length are supplied, reading of the body is attempted.
I have a preliminary patch that I will test and post next week.
Fix committed to classpath, test to mauve.
Subject: Bug 28580 Author: daney Date: Mon Sep 11 18:15:27 2006 New Revision: 116853 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116853 Log: PR classpath/28580 * gnu/java/net/protocol/http/Request.java (readResponse): Call createResponseBodyStream in more cases and with new parameter. (createResponseBodyStream): Added new parameter mayHaveBody. Handle HEAD and !mayHaveBody responses specially. Modified: trunk/libjava/classpath/ChangeLog.gcj trunk/libjava/classpath/gnu/java/net/protocol/http/Request.java