-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Unresolver: allow a full URL when un-resolving a domain #11632
base: main
Are you sure you want to change the base?
Conversation
This also checks that the URL has a valid protocol.
bbe0343
to
0638e30
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some questions about this PR.
I'm a little confused with the names here. We call this method unresolve_domain
, but it could also receive a URL now. However, we have another method called unresolve_url
. Shouldn't we standardize this and call unresolve_domain
or unresolve_url
depending on what the input we have?
With this changes, what is the difference between unresolve_url
and unresolve_domain
now?
with pytest.raises(InvalidSubdomainError): | ||
unresolve("https:///pip.readthedocs.io/en/latest/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this raises InvalidSubdomainError
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A tripe ///
is interpreted as a URL without a domain.
unresolve_domain will resolve the domain only, everything else is ignored (it's in the docstring). |
This also checks that the URL has a valid protocol. This is needed for https://github.com/readthedocs/readthedocs-corporate/pull/1887.