Skip to content

Commit 653ab1f

Browse files
committed
SWS-165
1 parent ec971fa commit 653ab1f

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

core/src/main/java/org/springframework/ws/transport/http/AbstractHttpSenderConnection.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ protected final boolean hasResponse() throws IOException {
6161
long contentLength = getResponseContentLength();
6262
if (contentLength < 0) {
6363
if (responseBuffer == null) {
64-
responseBuffer = FileCopyUtils.copyToByteArray(getResponseInputStream());
64+
responseBuffer = FileCopyUtils.copyToByteArray(getRawResponseInputStream());
6565
}
6666
contentLength = responseBuffer.length;
6767
}
@@ -98,6 +98,7 @@ private boolean isGzipResponse() throws IOException {
9898
/** Returns the length of the response. */
9999
protected abstract long getResponseContentLength() throws IOException;
100100

101+
/** Returns the raw, possibly compressed input stream to read the response from. */
101102
protected abstract InputStream getRawResponseInputStream() throws IOException;
102103

103104
/*

core/src/test/java/org/springframework/ws/transport/http/AbstractHttpWebServiceMessageSenderIntegrationTestCase.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,14 @@ public void testSendAndReceiveInvalidContentSize() throws Exception {
133133
validateResponse(servlet);
134134
}
135135

136+
public void testSendAndReceiveCompressedInvalidContentSize() throws Exception {
137+
MyServlet servlet = new MyServlet();
138+
servlet.setResponse(true);
139+
servlet.setGzip(true);
140+
servlet.setContentLength(-1);
141+
validateResponse(servlet);
142+
}
143+
136144
public void testSendAndReceiveFault() throws Exception {
137145
MyServlet servlet = new MyServlet();
138146
servlet.setResponseStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);

0 commit comments

Comments
 (0)