Skip to content

Commit c2ca7d7

Browse files
committed
fix: fix generic 404 errors
1 parent 713ee1a commit c2ca7d7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mcp-spring/mcp-spring-webflux/src/main/java/io/modelcontextprotocol/client/transport/WebClientStreamableHttpTransport.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,10 @@ else if (mediaType.isCompatibleWith(MediaType.APPLICATION_JSON)) {
326326
}
327327
}
328328
else {
329-
if (isNotFound(response) && !sessionRepresentation.equals(MISSING_SESSION_ID)) {
330-
return mcpSessionNotFoundError(sessionRepresentation);
329+
if (isNotFound(response)) {
330+
if (transportSession.sessionId().isPresent()) {
331+
return mcpSessionNotFoundError(sessionRepresentation);
332+
}
331333
}
332334
return this.extractError(response, sessionRepresentation);
333335
}

0 commit comments

Comments
 (0)