-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Unresolver: allow a full URL when un-resolving a domain #11632
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
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?
unresolve_domain will resolve the domain only, everything else is ignored (it's in the docstring). |
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.
This seems reasonable to keep the validation logic in 1 place 👍
readthedocs/core/unresolver.py
Outdated
if not domain: | ||
raise InvalidSubdomainError(domain) | ||
|
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.
Do we not want to put this check on line 562, since it's checking for the domain set there?
This also checks that the URL has a valid protocol. This is needed for readthedocs/readthedocs-corporate#1887.
This also checks that the URL has a valid protocol. This is needed for readthedocs/readthedocs-corporate#1887.
This also checks that the URL has a valid protocol. This is needed for https://github.com/readthedocs/readthedocs-corporate/pull/1887.