jericho 01/05/10 04:02:14
Modified: httpclient/src/java/org/apache/commons/httpclient
HttpClient.java
Log:
- Ignore the HTML docuement preceeding the HTTP response entity.
The apache server usually do that... ;( I don't know it's a spec or not.
- Remove the trim method.
Beacsuse the HTTP response entity always start with the new line.
Revision Changes Path
1.9 +10 -5
jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpClient.java
Index: HttpClient.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpClient.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- HttpClient.java 2001/05/07 20:09:28 1.8
+++ HttpClient.java 2001/05/10 11:02:11 1.9
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpClient.java,v
1.8 2001/05/07 20:09:28 morgand Exp $
- * $Revision: 1.8 $
- * $Date: 2001/05/07 20:09:28 $
+ * $Header:
/home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpClient.java,v
1.9 2001/05/10 11:02:11 jericho Exp $
+ * $Revision: 1.9 $
+ * $Date: 2001/05/10 11:02:11 $
*
* ====================================================================
*
@@ -914,12 +914,17 @@
protected void parseStatusLine(String statusLine, HttpMethod method)
throws IOException, HttpException {
- statusLine = statusLine.trim();
+ while (statusLine != null && !statusLine.startsWith("HTTP/")) {
+ statusLine = readLine(input);
+ }
if (debug > 0) {
System.out.println();
System.out.println(statusLine);
}
-
+ if (statusLine == null)
+ throw new HttpException
+ ("Error in parsing the response: " + statusLine);
+
int at = statusLine.indexOf(" ");
if (at < 0)
throw new HttpException