Support o.s.h.HttpHeaders from both 6.x and 7.x branches to enable migration to Spring 7 (#639)
This commit is contained in:
parent
0980f08e94
commit
14ff4a385d
1 changed files with 8 additions and 8 deletions
|
|
@ -240,7 +240,7 @@ public class WebMvcStreamableServerTransportProvider implements McpStreamableSer
|
|||
|
||||
McpTransportContext transportContext = this.contextExtractor.extract(request);
|
||||
|
||||
if (!request.headers().asHttpHeaders().containsKey(HttpHeaders.MCP_SESSION_ID)) {
|
||||
if (request.headers().header(HttpHeaders.MCP_SESSION_ID).isEmpty()) {
|
||||
return ServerResponse.badRequest().body("Session ID required in mcp-session-id header");
|
||||
}
|
||||
|
||||
|
|
@ -263,7 +263,7 @@ public class WebMvcStreamableServerTransportProvider implements McpStreamableSer
|
|||
sessionId, sseBuilder);
|
||||
|
||||
// Check if this is a replay request
|
||||
if (request.headers().asHttpHeaders().containsKey(HttpHeaders.LAST_EVENT_ID)) {
|
||||
if (!request.headers().header(HttpHeaders.LAST_EVENT_ID).isEmpty()) {
|
||||
String lastId = request.headers().asHttpHeaders().getFirst(HttpHeaders.LAST_EVENT_ID);
|
||||
|
||||
try {
|
||||
|
|
@ -354,7 +354,7 @@ public class WebMvcStreamableServerTransportProvider implements McpStreamableSer
|
|||
}
|
||||
|
||||
// Handle other messages that require a session
|
||||
if (!request.headers().asHttpHeaders().containsKey(HttpHeaders.MCP_SESSION_ID)) {
|
||||
if (request.headers().header(HttpHeaders.MCP_SESSION_ID).isEmpty()) {
|
||||
return ServerResponse.badRequest().body(new McpError("Session ID missing"));
|
||||
}
|
||||
|
||||
|
|
@ -433,7 +433,7 @@ public class WebMvcStreamableServerTransportProvider implements McpStreamableSer
|
|||
|
||||
McpTransportContext transportContext = this.contextExtractor.extract(request);
|
||||
|
||||
if (!request.headers().asHttpHeaders().containsKey(HttpHeaders.MCP_SESSION_ID)) {
|
||||
if (request.headers().header(HttpHeaders.MCP_SESSION_ID).isEmpty()) {
|
||||
return ServerResponse.badRequest().body("Session ID required in mcp-session-id header");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue