Skip to content

Commit

Permalink
Merge #3481 into 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
violetagg committed Oct 24, 2024
2 parents 586bd15 + 4c835a3 commit 494fb91
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,6 @@ Publisher<Void> requestWithBody(HttpClientOperations ch) {

if (!Objects.equals(method, HttpMethod.GET) &&
!Objects.equals(method, HttpMethod.HEAD) &&
!Objects.equals(method, HttpMethod.DELETE) &&
!headers.contains(HttpHeaderNames.CONTENT_LENGTH)) {
ch.chunkedTransfer(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.reactivestreams.Publisher;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
Expand Down Expand Up @@ -3489,4 +3490,27 @@ void testIssue3416() {
.expectComplete()
.verify(Duration.ofSeconds(5));
}

@ParameterizedTest
@ValueSource(booleans = {true, false})
void testDeleteMethod(boolean chunked) {
disposableServer =
createServer()
.handle((req, res) -> res.send(req.receive().retain()))
.bindNow();

Publisher<ByteBuf> body = chunked ?
ByteBufFlux.fromString(Flux.just("d", "e", "l", "e", "t", "e")) :
ByteBufMono.fromString(Mono.just("delete"));

createClient(disposableServer.port())
.delete()
.uri("/")
.send(body)
.responseSingle((res, bytes) -> bytes.asString())
.as(StepVerifier::create)
.expectNext("delete")
.expectComplete()
.verify(Duration.ofSeconds(5));
}
}

0 comments on commit 494fb91

Please sign in to comment.