fix port handling behavior on localhost 8000#20
Draft
Immortalin wants to merge 2 commits intomainfrom
Draft
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where output_url on localhost sometimes strips the port number by ensuring that when output_url is absolute, it uses the same port as self.api_url.
- Added URL parsing logic to detect port mismatches
- Updated output_url construction to append the correct port when needed
Comment on lines
+145
to
+146
| if api_port: | ||
| netloc += f":{api_port}" |
There was a problem hiding this comment.
The check for 'api_port' on line 145 is redundant given the preceding condition on line 143. Consider removing it to simplify the code.
Suggested change
| if api_port: | |
| netloc += f":{api_port}" | |
| netloc += f":{api_port}" |
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.
When running on localhost with port 8000,
output_urlsometimes strips the port number. This fixes the issue.