rfc3986 icon indicating copy to clipboard operation
rfc3986 copied to clipboard

wrong parse

Open Draeli opened this issue 11 months ago • 0 comments

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.

Draeli avatar Mar 05 '25 20:03 Draeli