Multi-value tornado headers are fetched with `get()` rather than `get_list()`

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

  • #1110 来自 @Prognosticate-X —— 已关闭,未合并
  • #1113 来自 @Fire162 —— 已关闭,未合并
  • #1114 来自 @X6M-Work —— 已关闭,未合并

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
62/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
backend

调研方向

从 tornado 解析器开始,multidict 的头部查找会在 tornado 的 HTTPHeaders 对象上调用 get(...)。用同一个头部名称的两次 add 调用复现该错误,然后比较 get 与 get_list。当回归测试显示重复头部以列表形式返回,并且解析器对它们的行为已修正时,即完成。由于之前的尝试是依据该政策被关闭的,请先阅读项目的 AI 贡献政策。

由索引模型根据 Issue 内容生成。

描述

In the tornado parser, we have multidict support for headers which gets data using get(...). This combines headers, and therefore gives wrong results.
Given the setup:

>>> import tornado
>>> h = tornado.httputil.HTTPHeaders()
>>> h.add("a", "foo")
>>> h.add("a", "bar")

Compare:

>>> h.get("a")
'foo,bar'
>>> h.get_list("a")
['foo', 'bar']

We should add a regression test for this and a fix.


This was flagged in #1108, which was summarily closed as a low-quality PR in violation of our AI policy.

主要语言
Python
星标
1.4k
派生
171
平均合并
8 小时 47 分钟
30 天内合并 PR
12

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

marshmallow-code/webargs 的其他 Issue

查看 marshmallow-code/webargs 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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