Fix httpRequestCustomizer usage in HttpClientStreamableHttpTransport

- Closes #458

Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
This commit is contained in:
Daniel Garnier-Moiroux 2025-08-07 09:32:40 +02:00 • committed by Christian Tzolov
commit 032716546c

View file

@ -400,7 +400,7 @@ public class HttpClientStreamableHttpTransport implements McpClientTransport {
.header("Cache-Control", "no-cache")
.header(HttpHeaders.PROTOCOL_VERSION, MCP_PROTOCOL_VERSION)
.POST(HttpRequest.BodyPublishers.ofString(jsonBody));
return Mono.from(this.httpRequestCustomizer.customize(builder, "GET", uri, jsonBody));
return Mono.from(this.httpRequestCustomizer.customize(builder, "POST", uri, jsonBody));
}).flatMapMany(requestBuilder -> Flux.<ResponseEvent>create(responseEventSink -> {
// Create the async request with proper body subscriber selection