Skip to content

fix: reject duplicate streamable HTTP initialize requests#969

Open
DragonFSKY wants to merge 1 commit into
modelcontextprotocol:mainfrom
DragonFSKY:fix/962-reject-duplicate-initialize
Open

fix: reject duplicate streamable HTTP initialize requests#969
DragonFSKY wants to merge 1 commit into
modelcontextprotocol:mainfrom
DragonFSKY:fix/962-reject-duplicate-initialize

Conversation

@DragonFSKY
Copy link
Copy Markdown

Summary

  • Reject duplicate initialize requests that include an active Mcp-Session-Id in the stateful Streamable HTTP transport.
  • Keep fresh initialize requests without a session ID working as before.
  • Add a focused servlet-level regression test covering initialize -> initialized -> duplicate initialize.

Fixes #962.

Testing

  • ./mvnw -pl mcp-test -am -Dtest=HttpServletStreamableServerTransportProviderTests -Dsurefire.failIfNoSpecifiedTests=false test
  • ./mvnw -pl mcp-test -am -Dtest=HttpServletStreamableIntegrationTests,HttpServletStreamableServerTransportProviderTests -Dsurefire.failIfNoSpecifiedTests=false test
  • ./mvnw -pl mcp-test -am -Pjackson2 -Dtest=HttpServletStreamableServerTransportProviderTests -Dsurefire.failIfNoSpecifiedTests=false test
  • ./mvnw -pl mcp-core,mcp-test spring-javaformat:validate
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate initialize is accepted after initialization and returns a new session ID

1 participant