uri_reference.is_valid() accepts invalid hostnames and out-of-range ports
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 45/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- python
- 領域
- networking
研究方向
先在 Python REPL 中重現兩個範例,並追蹤 uri_reference(...).is_valid() 如何驗證主機名稱和連接埠。完成標準是拒絕帶有路徑的裸主機名稱以及大於 65535 的連接埠,並透過測試涵蓋所回報的兩個輸入。
由索引模型根據 Issue 內容生成。
描述
The validator returns True for inputs that violate URI rules.
Examples:
In [15]: uri_reference('google.com/path').is_valid()
Out[15]: True
In [27]: uri_reference('http://example.com:99999/').is_valid()
Out[27]: True
Expected behavior:
The validator should reject missing schemes when a hostname is present
and should reject port values greater than 65535.
Actual behavior:
is_valid() returns True for both invalid inputs.
Steps to reproduce:
- Run the two example expressions in a Python REPL.
- Observe that both return True.
Environment:
Library version:
Python version: Python 3.10.14
OS: Windows
Fix? :
- Add port range validation and treat bare hostnames with paths as invalid
- unless explicitly allowed by the spec.
- 主要語言
- Python
- 星號
- 189
- 分支
- 43
- 平均合併
- 12 小時 14 分鐘
- 30 天內合併 PR
- 2
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
python-hyper/rfc3986 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 86/100
python-hyper/rfc3986#164 ·
-
ParseResultBytes.unsplit() raises AttributeError for a reference without an authority可能已有人在做 @mayuriphad 於 1 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 84/100
python-hyper/rfc3986#163 ·
-
sdist is missing `tox.ini`可能重新可做 關聯的 PR 已關閉且未合併。 未關閉
難度 2/5 1-3 小時 新手友好度 55/100
python-hyper/rfc3986#129 ·
-
wrong parse未關閉
難度 3/5 1-2 天 新手友好度 38/100
python-hyper/rfc3986#128 ·
-
難度 2/5 1-3 小時 新手友好度 35/100
python-hyper/rfc3986#123 · 2 則留言 ·
查看 python-hyper/rfc3986 的全部 Issue
相似的 Issue
-
難度 1/5 1-3 小時 新手友好度 85/100
WLAN-Pi/wlanpi-profiler#341 ·
維護者通常 1 天內回覆
-
Memory leak: the shared `validation_aborted_error` keeps every traceback it is raised through可能已有人在做 @Fire162 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
graphql-python/graphql-core#287 ·
-
難度 2/5 1-3 小時 新手友好度 67/100
roman-corgi/ctc-dip#160 ·
維護者通常 1 天內回覆
-
type-bug
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
render_findings.py reads and writes in the host's default encoding, so findings.html breaks on a cp1252 Windows host可能已有人在做 @Aaqibhafeezkhan 今天認領。 未關閉bug good first issue mentored python size: XS up-for-grabs
難度 2/5 1-3 小時 新手友好度 75/100
dheerajjha/mcp-migrate#366 · 1 則留言 ·
維護者通常 1 天內回覆