List query parameters are percent-encoded twice
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 88/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- backend, networking
Hướng nghiên cứu
Tìm build_query_param và chạy bản tái hiện được cung cấp với httpx.MockTransport để kiểm tra tham số collection_refs đã giải mã. Kiểm tra các bài kiểm tra tham số truy vấn gần đó và bổ sung trường hợp cho ký tự dành riêng; hoàn tất khi các phần tử danh sách chỉ được mã hóa một lần và bản tái hiện báo food:pizza.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Python
- Star
- 25
- Fork
- 14
- Merge trung bình
- 18 giờ 23 phút
- Pull request đã merge (30 ngày)
- 12
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của GetStream/stream-py
-
Daily integration run is redĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
GetStream/stream-py#293 · 10 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
RuntimeError: generator didn't yield in telemetry wrapper with Python 3.12.10+ (getstream 2.5.x)Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
GetStream/stream-py#161 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của GetStream/stream-py
Issue tương tự
-
comp/gateway comp/plugins duplicate P3 type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
NousResearch/hermes-agent#137019 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bot-triaged module: docs triaged
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
new-entry
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
BinWang28/audio-ai-hub#194 ·
-
confluence: a paged listing's links re-encode a parameter they carry, where real carries it as sentĐang mởfidelity
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
Maintainer thường phản hồi trong vòng 1 ngày