Refactored Undertow support to register a response listener only when
the body is written to, as opposed to registering it at startup. The
reason for this is that getting the response channel from the
HttpServerExchange commits the status and response, making it impossible
to change them after the fact.
Fixed issue #119.
@ -60,20 +50,11 @@ public class UndertowHttpHandlerAdapter implements io.undertow.server.HttpHandle
@@ -60,20 +50,11 @@ public class UndertowHttpHandlerAdapter implements io.undertow.server.HttpHandle
@ -106,183 +87,4 @@ public class UndertowHttpHandlerAdapter implements io.undertow.server.HttpHandle
@@ -106,183 +87,4 @@ public class UndertowHttpHandlerAdapter implements io.undertow.server.HttpHandle
@ -43,14 +49,14 @@ public class UndertowServerHttpRequest extends AbstractServerHttpRequest {
@@ -43,14 +49,14 @@ public class UndertowServerHttpRequest extends AbstractServerHttpRequest {
@ -92,7 +98,79 @@ public class UndertowServerHttpRequest extends AbstractServerHttpRequest {
@@ -92,7 +98,79 @@ public class UndertowServerHttpRequest extends AbstractServerHttpRequest {
Assert.notNull(exchange,"'exchange' is required.");
Assert.notNull(responseChannel,"'responseChannel' must not be null");
Assert.notNull(responseBodyWriter,"'responseBodyWriter' must not be null");
this.exchange=exchange;
this.responseChannel=responseChannel;
this.responseBodyWriter=responseBodyWriter;
}
@ -80,16 +74,26 @@ public class UndertowServerHttpResponse extends AbstractServerHttpResponse
@@ -80,16 +74,26 @@ public class UndertowServerHttpResponse extends AbstractServerHttpResponse
returnMono.error(newIOException("Could only write "+result+
" out of "+count+" bytes"));
@ -128,4 +132,107 @@ public class UndertowServerHttpResponse extends AbstractServerHttpResponse
@@ -128,4 +132,107 @@ public class UndertowServerHttpResponse extends AbstractServerHttpResponse
@ -173,7 +171,6 @@ public class RequestMappingIntegrationTests extends AbstractHttpHandlerIntegrati
@@ -173,7 +171,6 @@ public class RequestMappingIntegrationTests extends AbstractHttpHandlerIntegrati