Skip to content

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

Merged
merged 4 commits into from
Oct 24, 2024
Merged

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Sep 30, 2024

This also checks that the URL has a valid protocol. This is needed for https://github.com/readthedocs/readthedocs-corporate/pull/1887.

@stsewd stsewd requested a review from a team as a code owner September 30, 2024 22:07
@stsewd stsewd requested a review from humitos September 30, 2024 22:07
This also checks that the URL has a valid protocol.
Copy link
Member

@humitos humitos left a 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?

@humitos humitos requested a review from ericholscher October 1, 2024 08:27
@stsewd
Copy link
Member Author

stsewd commented Oct 1, 2024

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).

Copy link
Member

@ericholscher ericholscher left a 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 👍

Comment on lines 568 to 570
if not domain:
raise InvalidSubdomainError(domain)

Copy link
Member

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?

@stsewd stsewd merged commit c352332 into main Oct 24, 2024
5 of 6 checks passed
@stsewd stsewd deleted the check-uri-protocol branch October 24, 2024 22:20
stsewd added a commit that referenced this pull request Oct 29, 2024
This also checks that the URL has a valid protocol. This is needed for readthedocs/readthedocs-corporate#1887.
stsewd added a commit that referenced this pull request Oct 29, 2024
This also checks that the URL has a valid protocol. This is needed for readthedocs/readthedocs-corporate#1887.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants