Skip to content

Commit be29b1c

Browse files
committed
SWS-583 - AbstractHttpSenderConnection does not immediately recognise HTTP 204 has no content-length
1 parent 9fd6a22 commit be29b1c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ public final String getErrorMessage() throws IOException {
6060
* Receiving response
6161
*/
6262
protected final boolean hasResponse() throws IOException {
63-
if (HttpTransportConstants.STATUS_ACCEPTED == getResponseCode()) {
63+
int responseCode = getResponseCode();
64+
if (HttpTransportConstants.STATUS_ACCEPTED == responseCode ||
65+
HttpTransportConstants.STATUS_NO_CONTENT == responseCode) {
6466
return false;
6567
}
6668
long contentLength = getResponseContentLength();

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ public interface HttpTransportConstants extends TransportConstants {
4141
/** The "202 Accepted" status code. */
4242
int STATUS_ACCEPTED = 202;
4343

44+
/** The "204 No Content" status code. */
45+
int STATUS_NO_CONTENT = 204;
46+
4447
/** The "404 Not Found" status code. */
4548
int STATUS_NOT_FOUND = 404;
4649

0 commit comments

Comments
 (0)