Skip to content

Commit

Permalink
Merge #3481 into 2.0.0-M4
Browse files Browse the repository at this point in the history
  • Loading branch information
violetagg committed Oct 24, 2024
2 parents 4b94c4c + 494fb91 commit 803e083
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 @@ -488,7 +488,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 @@ -98,6 +98,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 @@ -3410,6 +3411,29 @@ void testIssue3416() {
.verify(Duration.ofSeconds(5));
}

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

Publisher<Buffer> body = chunked ?
BufferFlux.fromString(Flux.just("d", "e", "l", "e", "t", "e")) :
BufferMono.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));
}

static final class TestMeterRegistrar implements ConnectionProvider.MeterRegistrar {

AtomicReference<ConnectionPoolMetrics> m = new AtomicReference<>();
Expand Down

0 comments on commit 803e083

Please sign in to comment.