List query parameters are percent-encoded twice
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 88/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- python
- 领域
- backend, networking
调研方向
找到 build_query_param,并运行提供的 httpx.MockTransport 复现用例,以检查解码后的 collection_refs 参数。查看附近的查询参数测试,并为保留字符添加覆盖;完成标准是列表项仅编码一次,且复现用例报告 food:pizza。
由索引模型根据 Issue 内容生成。
描述
Description
build_query_param percent-encodes each item of a list parameter with urllib.parse.quote before it joins the items with commas. httpx then encodes the whole query string again, so every character that quote escapes reaches the server double-encoded.
For example, client.feeds.read_collections(collection_refs=["food:pizza"]) sends:
GET /api/v2/feeds/collections?collection_refs=food%253Apizza
The server decodes this once to food%3Apizza instead of food:pizza. Collection references always contain :, so read_collections and delete_collections cannot match any collection. The same applies to any list parameter item that contains a space, :, @, , or another reserved character, for example in get_many_messages(ids=...), member_custom_include and the moderation ids.
getstream-go and stream-node join list items with commas and encode the query string once, so they send collection_refs=food%3Apizza.
Steps to reproduce
import httpx
from getstream import Stream
seen = []
client = Stream(
api_key="key",
api_secret="secret",
transport=httpx.MockTransport(
lambda r: seen.append(r)
or httpx.Response(200, json={"duration": "0ms", "collections": []})
),
)
client.feeds.read_collections(collection_refs=["food:pizza"])
print(seen[0].url.params["collection_refs"])
Expected output: food:pizza
Actual output: food%3Apizza
- 主要语言
- Python
- 星标
- 25
- 派生
- 14
- 平均合并
- 18 小时 23 分钟
- 30 天内合并 PR
- 12
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
GetStream/stream-py 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 45/100
GetStream/stream-py#293 · 10 条评论 ·
维护者通常 1 天内回复
-
RuntimeError: generator didn't yield in telemetry wrapper with Python 3.12.10+ (getstream 2.5.x)未关闭
难度 3/5 1-2 天 新手友好度 42/100
GetStream/stream-py#161 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 30/100
维护者通常 1 天内回复
查看 GetStream/stream-py 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
sierra-research/tau2-bench#635 ·
维护者通常 1 天内回复
-
The add-ssm-model skill requires a Cython simulator; the contributing guide allows Python ones可能已有人在做 @fmuia 今天认领。 未关闭documentation skill
难度 2/5 1-3 小时 新手友好度 83/100
lnccbrown/ssm-simulators#406 ·
维护者通常 4 天内回复
-
难度 1/5 1 小时以内 新手友好度 95/100
btclib-org/btclib-ecc#309 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
jbacalso24/mimry#459 · 1 条评论 ·
维护者通常 1 天内回复
-
auth bug high-priority
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复