TS SDK: `ctx.http.fetch` splits header values that contain commas
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 76/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- api
调研方向
该缺陷位于 crates/bindings-typescript/src/server/http_shared.ts 中的 serializeHeaders()(约第 62 行),它调用了 headers-polyfill 的 headersToList(),因此会拆分包含逗号的值。请先阅读该函数,以及它的输出如何传递到 ctx.http.fetch,然后用一个包含逗号的单个 header 值进行复现。完成的标准是:该值被原样发送,而调用方以数组形式传入的值仍然会变成独立的 header 行。添加测试前,先检查是否已有覆盖 serializeHeaders 的测试。
由索引模型根据 Issue 内容生成。
描述
Version: 2.11.0, still on master e596513
Where: crates/bindings-typescript/src/server/http_shared.ts, serializeHeaders() (~L62)
serializeHeaders uses headers-polyfill's headersToList(), which splits any value containing a comma into
separate values, so the host sends separate header lines:
ctx.http.fetch(url, { method: 'POST', headers: { 'webhook-signature': 'v1,mf3NSumak46pFQ8AgeTg5fboQUCyeXw3TcawjLmuuSI=' }, body });
Actual on the wire:
webhook-signature: v1
webhook-signature: mf3NSumak46pFQ8AgeTg5fboQUCyeXw3TcawjLmuuSI=
The receiver reads it as v1, mf3NSum…, which no Standard Webhooks verifier accepts. Any single-valued header
containing a comma is affected: Stripe-style t=…,v1=… signatures, HTTP Message Signatures, Cookie,
If-Modified-Since dates, Accept lists. Rust and C# modules send the value intact.
Expected: the header value is sent as given.
Fix: iterate headers.entries() (or the raw init) instead of headersToList. Only split values the caller passed
as arrays.
- 主要语言
- Rust
- 星标
- 25.3k
- 派生
- 1.1k
- 平均合并
- 4 天 6 小时
- 30 天内合并 PR
- 43
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
clockworklabs/SpacetimeDB 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
clockworklabs/SpacetimeDB#6146 ·
维护者通常 1 天内回复
-
TS SDK: `t.result()` is typed `Ok | Err`, but the runtime expects `{ ok } | { err }`可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
clockworklabs/SpacetimeDB#6127 ·
维护者通常 1 天内回复
-
TS SDK: `ctx.http.fetch` throws for status codes the `statuses` package doesn't know可能已有人在做 @kshanxs 于 2 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 82/100
clockworklabs/SpacetimeDB#6126 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
clockworklabs/SpacetimeDB#6124 ·
维护者通常 1 天内回复
-
TS SDK: `Result` errors are serialized with the `ok` type (instance crash)可能已有人在做 @Tyagiquamar 于 1 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 85/100
clockworklabs/SpacetimeDB#6122 ·
维护者通常 1 天内回复
查看 clockworklabs/SpacetimeDB 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 75/100
RustCrypto/SSH#596 ·
-
proxy: SQL-over-HTTP turns empty arrays into [""] or [false], or HTTP 500 for int and float arrays未关闭
难度 2/5 1-3 小时 新手友好度 83/100
neondatabase/neon#12965 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
goauthentik/authentik#26867 ·
维护者通常 1 天内回复
-
Table and code-block right borders are clipped when the TOC panel is resized wider than the default未关闭
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
api bug macos maintainer-needed p2 triaged
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复