Ensure buffers released in HttpHeadResponseDecorator

See gh-25908
This commit is contained in:
Rossen Stoyanchev
2020-10-13 23:38:59 +01:00
parent 1d96f6a266
commit 431ec906c4
2 changed files with 5 additions and 2 deletions

View File

@@ -66,8 +66,9 @@ public class HttpHeadResponseDecoratorTests {
@Test // gh-25908
public void writeWithGivenTransferEncoding() {
Flux<DataBuffer> body = Flux.just(toDataBuffer("data1"), toDataBuffer("data2"));
this.response.getHeaders().add(HttpHeaders.TRANSFER_ENCODING, "chunked");
this.response.writeWith(Flux.empty()).block();
this.response.writeWith(body).block();
assertThat(this.response.getHeaders().getContentLength()).isEqualTo(-1);
}