Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

TS SDK: `ctx.http.fetch` splits header values that contain commas

未关闭 适合新手
#6,123 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@kshanxs 已经在做这个了。

开始于 2026年10月11日。

  • #6140 来自 @kshanxs —— 未关闭

评估

难度
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 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

clockworklabs/SpacetimeDB 的其他 Issue

查看 clockworklabs/SpacetimeDB 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。