PEP 3333: URL-decoding and routing
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 25/100
- Issue 類型
- 文件
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- python
- 領域
- api, backend, documentation
研究方向
首先閱讀 PEP 3333 和連結的 Starlette 討論,然後將其中描述的路由行為與 RFC 3986 第 2.2 和 2.4 節進行比較。當專案就應如何處理百分比編碼的路徑元件達成明確共識後,工作即告完成。
由索引模型根據 Issue 內容生成。
描述
There have been several discussions over the years about how WSGI frameworks apply routing in the case of URL-encoded path components. Here's a comment that links to a few of the discussions:
https://github.com/encode/starlette/pull/1828#issuecomment-1434043248
The issue is that when using routing features, the URL /user/foo/edit appears to be indistinguishable from /user/foo%2Fedit, and in case of routing rules for /user/{username} and /user/{username}/edit, the URL /user/foo%2Fedit will match the second rule and not the first.
This seems to me to be in conflict with RFC 3986 section 2.4 and RFC 3986 section 2.2. The latter states:
URIs that differ in the replacement of a reserved character with its corresponding percent-encoded octet are not equivalent.
But the routing mechanism in popular WSGI frameworks such as Flask and FastAPI are unable to differentiate the mentioned URLs, because the URI's percent-encoding is decoded before the routing happens.
I believe PEP-3333 needs to clarify the correct behaviour.
- 主要語言
- reStructuredText
- 星號
- 5k
- 分支
- 1.8k
- 平均合併
- 1 天 15 小時
- 30 天內合併 PR
- 34
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
python/peps 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 65/100
維護者通常 1 天內回覆
-
infra
難度 3/5 1-2 天 新手友好度 55/100
python/peps#5158 · 3 個 reaction ·
維護者通常 1 天內回覆
-
New PEP Editors?未關閉meta
難度 5/5 一週以上 新手友好度 25/100
python/peps#5080 · 3 則留言 · 3 個 reaction ·
維護者通常 1 天內回覆
-
infra
難度 3/5 1-2 天 新手友好度 55/100
python/peps#4924 · 6 則留言 · 1 個 reaction ·
維護者通常 1 天內回覆
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 86/100
modelcontextprotocol/go-sdk#1340 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 85/100
modelcontextprotocol/ext-skills#156 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 78/100
Effect-TS/effect#8728 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 87/100
heygen-com/hyperframes#5002 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 85/100
CopilotKit/OpenDots#55 ·
維護者通常 1 天內回覆