Fix releasing bug in StringDecoder
This commit fixes an issue in StringDecoder, where, if the buffer did not contain any delimiters, it was released before it was relayed to any subscribers. Closes gh-29119
This commit is contained in:
@@ -1258,6 +1258,26 @@ class WebClientIntegrationTests {
|
||||
.verify();
|
||||
}
|
||||
|
||||
@ParameterizedWebClientTest
|
||||
void retrieveTextDecodedToFlux(ClientHttpConnector connector) {
|
||||
startServer(connector);
|
||||
|
||||
prepareResponse(response -> response
|
||||
.setHeader("Content-Type", "text/plain")
|
||||
.setBody("Hey now"));
|
||||
|
||||
Flux<String> result = this.webClient.get()
|
||||
.uri("/")
|
||||
.accept(MediaType.TEXT_PLAIN)
|
||||
.retrieve()
|
||||
.bodyToFlux(String.class);
|
||||
|
||||
StepVerifier.create(result)
|
||||
.expectNext("Hey now")
|
||||
.expectComplete()
|
||||
.verify(Duration.ofSeconds(3));
|
||||
}
|
||||
|
||||
private <T> Mono<T> doMalformedChunkedResponseTest(
|
||||
ClientHttpConnector connector, Function<ResponseSpec, Mono<T>> handler) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user