modelcontextprotocol / modelcontextprotocol/java-sdk
Resolve message endpoint path using request context path
还没有人认领这个 Issue。
- 主要语言
- Java
- 星标
- 3.7k
- 派生
- 1.1k
- 平均合并
- 1 天 15 小时
- 30 天内合并 PR
- 9
描述
When HttpServletSseServerTransportProvider handling the GET request to establish a new SSE connection, the message endpoint is advertised using the immutable field "baseUrl" that's set in the constructor:
// Send initial endpoint event this.sendEvent(writer, ENDPOINT_EVENT_TYPE, this.baseUrl + this.messageEndpoint + "?sessionId=" + sessionId);
This will not work if clients use a different base URL to access this servlet (e.g.: using reverse proxies). The servlet implementation should allow the request context path to be used to produce the endpoint path appropriate for that request:
// Send initial endpoint event this.sendEvent(writer, ENDPOINT_EVENT_TYPE, request.getContextPath() + this.messageEndpoint + "?sessionId=" + sessionId);
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 HttpServletSseServerTransportProvider 开始,找到用于建立新 SSE 连接并发送初始 endpoint 事件的 GET handler。跟踪 request context path 和 message endpoint 在那里如何可用,然后验证对于位于反向代理后的客户端,公布的 endpoint 使用了 context path。完成的标准是 endpoint URL 从 request 推导,而不是从不可变的 baseUrl 推导。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java
- 领域
- api, backend
- Issue 类型
- 缺陷
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 冷清
- 描述清晰度
- 描述清楚
- 新手友好度
- 68/100