Fixed response status message string, that was trimmed after the first
space.
This commit is contained in:
parent
9e1cac33d0
commit
65e13ce08f
|
@ -166,12 +166,14 @@ public class ResponseContentParser extends StreamContentParser
|
||||||
|
|
||||||
// Need to set the response status so the
|
// Need to set the response status so the
|
||||||
// HttpParser can handle the content properly.
|
// HttpParser can handle the content properly.
|
||||||
String[] parts = httpField.getValue().split(" ");
|
String value = httpField.getValue();
|
||||||
int code = Integer.parseInt(parts[0]);
|
String[] parts = value.split(" ");
|
||||||
|
String status = parts[0];
|
||||||
|
int code = Integer.parseInt(status);
|
||||||
httpParser.setResponseStatus(code);
|
httpParser.setResponseStatus(code);
|
||||||
String reason = parts.length > 1 ? parts[1] : HttpStatus.getMessage(code);
|
String reason = parts.length > 1 ? value.substring(status.length()) : HttpStatus.getMessage(code);
|
||||||
|
|
||||||
notifyBegin(code, reason);
|
notifyBegin(code, reason.trim());
|
||||||
notifyHeaders(fields);
|
notifyHeaders(fields);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue