python-hyper / python-hyper/rfc3986

wrong parse

Open
#128 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
189
Forks
38
Avg merge
13h 36m
Merged PRs (30d)
1

Description

Working on filtering URL system I found that case where False is expected but return True.

Code to test :

from rfc3986 import is_valid_uri

def test_url(url: str) -> bool:
    try:
        assert is_valid_uri(url, require_scheme=True, require_authority=True, require_path=False)
    except AssertionError:
        return False
    return True

url = "http://'www.amazon.com/s/url=search-alias\%3dstripbooks&field-keywords=z+programming'"
test_url(url)

To be more precise in the report, while RFC 3386 does not explicitly forbid the character ' both RFC1123 and RFC952 prohibit this character in DNS names. Therefore, it should be taken into consideration for this case.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the is_valid_uri entry point and reproduce the URL from the issue, focusing on how the authority and hostname are validated. Confirm that this input is rejected as described, then add a regression test covering the quoted hostname and run the relevant test suite.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.