Skip to content

Conversation

@Immortalin
Copy link
Collaborator

@Immortalin Immortalin commented Jun 4, 2025

When running on localhost with port 8000, output_url sometimes strips the port number. This fixes the issue.

@Immortalin Immortalin requested a review from acmisiti June 4, 2025 18:46
@Immortalin Immortalin self-assigned this Jun 4, 2025
@Immortalin Immortalin requested a review from Copilot June 4, 2025 18:46

This comment was marked as outdated.

@Immortalin Immortalin requested a review from Copilot June 4, 2025 18:50
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}"
Copy link

Copilot AI Jun 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}"

Copilot uses AI. Check for mistakes.
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.

2 participants