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分
- マージ済み PR(30日)
- 12
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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
-
md/asciidoc/csv: an explicit `encoding="utf-8"` keeps a leading BOM, the auto-detect path drops itオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
docling-project/docling#4846 ·
メンテナーはふだん 1 日以内に返信
-
area/sessions comp/dashboard comp/desktop comp/gateway comp/tui duplicate P2 sweeper:risk-session-state type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NousResearch/hermes-agent#138914 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bot-triaged module: activation checkpointing module: inductor oncall: pt2 triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
[oblt-aw][autodoc] Update PR Actions Detective E2E prerequisites and fix dashboard-format table typoオープンdocumentation
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
elastic/oblt-aw#2382 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信