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
- 派生
- 38
- 平均合并
- 13 小时 36 分钟
- 30 天内合并 PR
- 1
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
python-hyper/rfc3986 的其他 Issue
-
难度 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 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
python-hyper/rfc3986#122 · 3 条评论 · 1 个 reaction ·
-
Label 未关闭
难度 5/5 一周以上 新手友好度 1/100
python-hyper/rfc3986#120 ·
查看 python-hyper/rfc3986 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 86/100
zostera/django-bootstrap4#894 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
use-agent-os/agent-os#3276 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
难度 2/5 1-3 小时 新手友好度 88/100
NousResearch/hermes-agent#117848 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
zilliztech/memsearch#759 ·