WebFlux supports HTTP HEAD

Issue: SPR-15994
This commit is contained in:
Rossen Stoyanchev
2017-09-27 14:57:56 -04:00
parent d8d74faab8
commit 6ee1af27c6
10 changed files with 153 additions and 35 deletions

View File

@@ -79,6 +79,15 @@ public class RequestMappingIntegrationTests extends AbstractRequestMappingIntegr
assertEquals(expected, performGet("/object-stream-result", MediaType.ALL, String.class).getBody());
}
@Test
public void httpHead() throws Exception {
String url = "http://localhost:" + this.port + "/param?name=George";
HttpHeaders headers = getRestTemplate().headForHeaders(url);
String contentType = headers.getFirst("Content-Type");
assertNotNull(contentType);
assertEquals("text/html;charset=utf-8", contentType.toLowerCase());
assertEquals(13, headers.getContentLength());
}
@Configuration
@EnableWebFlux