-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Host ']' #90
Comments
Also a problem when host is '[' |
Happy to accept a fix here |
The question here is whether the validation should or should not be implicit when using In [1]: from rfc3986 import uri_reference
In [2]: uri_reference("B://]")
Out[2]: URIReference(scheme='B', authority=']', path=None, query=None, fragment=None) But you can simply check the validity of the result by the In [3]: _.is_valid()
Out[3]: False If you want the validation to happen immediately during parsing, you can use In [4]: from rfc3986 import ParseResult
In [5]: ParseResult.from_string("B://]")
…
InvalidAuthority: The authority (]) is not valid. So, because the lib is already able to say that the URL is invalid, it's more a design decision if the validation should happen by default. |
Pretty sure Maybe we need to make that clearer in the docs |
@kenballus could you please clarify which approach did you use? |
My mistake; using Why is it that we have a non-validating parser? Some large projects (httpx) use this parser, and would probably be better off using |
The following malformed URL is accepted by rfc3986:
Although the character
']'
is allowed in a host, it must be in the context of an IPv6 or an IPvFuture, which this is not.This malformed URL is rejected by urllib, urllib3, hyperlink, yarl, furl, and Boost.URL.
The text was updated successfully, but these errors were encountered: