This commit is contained in:
Arjen Poutsma
2007-09-09 21:34:34 +00:00
parent ec971fa029
commit 653ab1f179
2 changed files with 10 additions and 1 deletions

View File

@@ -61,7 +61,7 @@ public abstract class AbstractHttpSenderConnection extends AbstractSenderConnect
long contentLength = getResponseContentLength();
if (contentLength < 0) {
if (responseBuffer == null) {
responseBuffer = FileCopyUtils.copyToByteArray(getResponseInputStream());
responseBuffer = FileCopyUtils.copyToByteArray(getRawResponseInputStream());
}
contentLength = responseBuffer.length;
}
@@ -98,6 +98,7 @@ public abstract class AbstractHttpSenderConnection extends AbstractSenderConnect
/** Returns the length of the response. */
protected abstract long getResponseContentLength() throws IOException;
/** Returns the raw, possibly compressed input stream to read the response from. */
protected abstract InputStream getRawResponseInputStream() throws IOException;
/*

View File

@@ -133,6 +133,14 @@ public abstract class AbstractHttpWebServiceMessageSenderIntegrationTestCase ext
validateResponse(servlet);
}
public void testSendAndReceiveCompressedInvalidContentSize() throws Exception {
MyServlet servlet = new MyServlet();
servlet.setResponse(true);
servlet.setGzip(true);
servlet.setContentLength(-1);
validateResponse(servlet);
}
public void testSendAndReceiveFault() throws Exception {
MyServlet servlet = new MyServlet();
servlet.setResponseStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);