[v2] URI template strict expansions leave !'()* unencoded
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 84/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- api
调研方向
从 packages/core-internal/src/shared/uriTemplate.ts 开始,重点关注 UriTemplate.expand() 和 encodeValue(),然后使用 Node.js 24 或更高版本运行 repro.mjs 示例。完成的标准是 simple 和 query 扩展会按所示对 !'()* 进行百分号编码,而 reserved 和 fragment 扩展会保留其允许的字符。
由索引模型根据 Issue 内容生成。
描述
What happened?
UriTemplate.expand() leaves !'()* unchanged in simple expansions. Query values have the same problem: search{?q} with q: 'hello!' produces search?q=hello!.
encodeURIComponent() leaves these characters unchanged, and encodeValue() returns that output directly for strict expansion operators.
What did you expect?
Expected output from the snippet below:
%21%27%28%29%2A
search?q=hello%21
RFC 6570 section 3.2.1 permits unreserved characters in strict variable expansions. The five characters above are reserved and need percent-encoding. Reserved and fragment expansions can keep them.
Code to reproduce
Save this as repro.mjs at the SDK repository root and run node repro.mjs with Node.js 24 or later. It imports the source module directly.
import { UriTemplate } from './packages/core-internal/src/shared/uriTemplate.ts';
const value = "!'()*";
console.log(new UriTemplate('{value}').expand({ value }));
console.log(new UriTemplate('search{?q}').expand({ q: 'hello!' }));
Current output:
!'()*
search?q=hello!
SDK version
main at e16d27729ea2fae144a6d957fd0372d9eb0e6c58 (v2 source checkout). Tested with Node.js 24.12.0.
Area
Other
- 主要语言
- TypeScript
- 星标
- 13.5k
- 派生
- 2.3k
- 平均合并
- 1 天 22 小时
- 30 天内合并 PR
- 52
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
modelcontextprotocol/typescript-sdk 的其他 Issue
-
Stateless 405 response omits the Allow header可能已有人在做 @jstar0 于 1 天前认领。 未关闭v2
难度 2/5 1-3 小时 新手友好度 82/100
modelcontextprotocol/typescript-sdk#2970 · 2 条评论 ·
维护者通常 1 天内回复
-
[v2] @modelcontextprotocol/server inlines fast-uri 3.1.0, which has 9 published advisories可能已有人在做 @Andiii208 于 1 天前认领。 未关闭v2
难度 2/5 1-3 小时 新手友好度 72/100
modelcontextprotocol/typescript-sdk#2966 · 3 条评论 ·
维护者通常 1 天内回复
-
v1 v2
难度 2/5 1-3 小时 新手友好度 72/100
modelcontextprotocol/typescript-sdk#2946 · 4 条评论 ·
维护者通常 1 天内回复
-
[v2] URI template reserved expansions encode existing %HH sequences again可能已有人在做 @takagibit18 于 7 天前认领。 未关闭v1 v2
难度 2/5 1-3 小时 新手友好度 84/100
modelcontextprotocol/typescript-sdk#2920 · 1 条评论 ·
维护者通常 1 天内回复
-
Malformed params on spec request methods return -32603 Internal error instead of -32602 Invalid params可能已有人在做 @Gauravtiwari31 于 8 天前认领。 未关闭v1 v2
难度 2/5 1-3 小时 新手友好度 78/100
modelcontextprotocol/typescript-sdk#2916 · 3 条评论 ·
维护者通常 1 天内回复
查看 modelcontextprotocol/typescript-sdk 的全部 Issue
相似的 Issue
-
[Bug] The clients language filter cannot select the rows the page labels as unknown可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
apache/rocketmq-dashboard#6103 ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
cockpit-project/cockpit-machines#2835 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
cloudflare/kumo#866 ·
维护者通常 1 天内回复
-
area:connector bug
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复
-
autoInject recall silently drops memory injection on long / non-Latin prompts (HTTP 400 Query too long)可能已有人在做 @Epsilon006 今天认领。 未关闭integration:coding-agents
难度 2/5 1-3 小时 新手友好度 72/100
vectorize-io/hindsight#5476 · 1 条评论 ·
维护者通常 1 天内回复