Allow to set response status on Undertow

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.
This commit is contained in:
Arjen Poutsma
2016-06-30 15:26:17 +02:00
parent 2418ff0ad4
commit 1d48e7c5b9
4 changed files with 209 additions and 225 deletions

View File

@@ -67,9 +67,7 @@ import org.springframework.web.reactive.config.WebReactiveConfiguration;
import org.springframework.web.reactive.result.view.freemarker.FreeMarkerConfigurer;
import org.springframework.web.server.adapter.WebHttpHandlerBuilder;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.*;
/**
@@ -173,7 +171,6 @@ public class RequestMappingIntegrationTests extends AbstractHttpHandlerIntegrati
}
@Test
@Ignore // Issue #119
public void serializeAsMonoResponseEntity() throws Exception {
serializeAsPojo("http://localhost:" + port + "/monoResponseEntity");
}