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

List query parameters are percent-encoded twice

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

维护者通常 1 天内回复

@RaphaelFakhri 已经在做这个了。

开始于 2026年10月10日。

  • #306 来自 @RaphaelFakhri —— 未关闭

评估

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

调研方向

找到 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,通用步骤见我们的新手贡献指南。

从这里开始

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

GetStream/stream-py 的其他 Issue

查看 GetStream/stream-py 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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