From c2ca7d7449fef69f19ac6e210a547e3183ba2e37 Mon Sep 17 00:00:00 2001 From: ronantakizawa Date: Tue, 12 Aug 2025 11:00:48 -0600 Subject: [PATCH] fix: fix generic 404 errors --- .../client/transport/WebClientStreamableHttpTransport.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mcp-spring/mcp-spring-webflux/src/main/java/io/modelcontextprotocol/client/transport/WebClientStreamableHttpTransport.java b/mcp-spring/mcp-spring-webflux/src/main/java/io/modelcontextprotocol/client/transport/WebClientStreamableHttpTransport.java index 853aed2bf..648e8b3ea 100644 --- a/mcp-spring/mcp-spring-webflux/src/main/java/io/modelcontextprotocol/client/transport/WebClientStreamableHttpTransport.java +++ b/mcp-spring/mcp-spring-webflux/src/main/java/io/modelcontextprotocol/client/transport/WebClientStreamableHttpTransport.java @@ -326,8 +326,10 @@ else if (mediaType.isCompatibleWith(MediaType.APPLICATION_JSON)) { } } else { - if (isNotFound(response) && !sessionRepresentation.equals(MISSING_SESSION_ID)) { - return mcpSessionNotFoundError(sessionRepresentation); + if (isNotFound(response)) { + if (transportSession.sessionId().isPresent()) { + return mcpSessionNotFoundError(sessionRepresentation); + } } return this.extractError(response, sessionRepresentation); }