if (!s.startsWith("HTTP/")) throw new HTTPException("Expected reply to start with \"HTTP/\"");
String reply = s.substring(s.indexOf(' ') + 1);
if (!reply.startsWith("2")) throw new HTTPException("HTTP Error: " + reply);
- while((s = headerReader.readLine()) != null) {
- if (s.length() > 15 && s.substring(0, 15).equalsIgnoreCase("content-length: "))
- contentLength = Integer.parseInt(s.substring(15));
- }
+ while((s = headerReader.readLine()) != null)
+ if (s.length() > 15 && s.substring(0, 16).equalsIgnoreCase("content-length: "))
+ contentLength = Integer.parseInt(s.substring(16));
return in;
}