Open
Conversation
BigRoy
reviewed
May 1, 2026
Comment on lines
+803
to
+805
| if parsed_url.path: | ||
| new_path = f"{parsed_url.scheme}{parsed_url.netloc}" | ||
| hints.append(f"did you mean \"{new_path}\"?") |
Contributor
There was a problem hiding this comment.
Pretty sure this would now also be hinted if you had passed it a completely valid URL but the connection just failed? This may need a check that new_path != url perhaps?
There was a problem hiding this comment.
Pull request overview
This PR updates validate_url to be more tolerant of user-entered AYON server URLs by accepting URLs that include a path (e.g. /login) and by improving handling of inputs like localhost:5000 without an explicit scheme.
Changes:
- Validate server reachability by requesting the AYON
/api/infoendpoint. - Prepend a default
http://scheme when the input doesn’t specify one. - If a path is present, attempt to validate/connect using only the scheme+host portion of the URL.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "did you mean \"{}\"?".format(parsed_url.scheme + new_path) | ||
| ) | ||
| if parsed_url.path: | ||
| new_path = f"{parsed_url.scheme}{parsed_url.netloc}" |
Comment on lines
572
to
+578
| response = requests.get( | ||
| url, | ||
| f"{url}/api/info", | ||
| timeout=timeout, | ||
| verify=verify, | ||
| cert=cert, | ||
| ) | ||
| _ = response.json() |
| # Not sure if this is good idea? | ||
| modified_url = stripperd_url.rstrip("/") | ||
|
|
||
| # Make sure url has http schema |
Comment on lines
+764
to
+765
| # Make sure url has http schema | ||
| if not modified_url.lower().startswith("http"): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog Description
Validate url function is more benevolent and allows url with path.
Additional review information
Validate url allows to pass in nested url with path e.g.
dev.ayon.app/loginwould be resolved ashttp://dev.ayon.app. Also fixes issue if localhost url is used without schemelocalhost:5000is resolved ashttp://localhost:5000, the issue was thatlocalhostwas resolved as scheme because of:in the url.This function is used in ayon launcher for login window.
Testing notes:
This is requirement for ynput/ayon-launcher#208 .