SWS-583 - AbstractHttpSenderConnection does not immediately recognise HTTP 204 has no content-length

This commit is contained in:
Arjen Poutsma
2010-01-06 14:40:03 +00:00
parent 9fd6a22f4d
commit be29b1c3af
2 changed files with 6 additions and 1 deletions

View File

@@ -60,7 +60,9 @@ public abstract class AbstractHttpSenderConnection extends AbstractSenderConnect
* Receiving response
*/
protected final boolean hasResponse() throws IOException {
if (HttpTransportConstants.STATUS_ACCEPTED == getResponseCode()) {
int responseCode = getResponseCode();
if (HttpTransportConstants.STATUS_ACCEPTED == responseCode ||
HttpTransportConstants.STATUS_NO_CONTENT == responseCode) {
return false;
}
long contentLength = getResponseContentLength();

View File

@@ -41,6 +41,9 @@ public interface HttpTransportConstants extends TransportConstants {
/** The "202 Accepted" status code. */
int STATUS_ACCEPTED = 202;
/** The "204 No Content" status code. */
int STATUS_NO_CONTENT = 204;
/** The "404 Not Found" status code. */
int STATUS_NOT_FOUND = 404;