-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
BUG: Include port number if present #582
Conversation
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.
Thank you for the PR.
The fix works as expected, however, could you please add a test for this? The code snippet from the bug report issue should suffice.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #582 +/- ##
==========================================
+ Coverage 81.68% 81.70% +0.01%
==========================================
Files 69 69
Lines 7089 7093 +4
==========================================
+ Hits 5791 5795 +4
Misses 1298 1298 ☔ View full report in Codecov by Sentry. |
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.
Overall looks good. I push the fstrings, the style check fixes and a changelog entry in a new commit and then will go ahead with merging this.
Thank you @chmmao!
pyvo/dal/vosi.py
Outdated
endpoint=endpoint), | ||
|
||
return [ | ||
'{baseurl}/{endpoint}'.format(baseurl=curated_baseurl, endpoint=endpoint), |
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.
Use fstring here, too.
pyvo/dal/vosi.py
Outdated
netloc = urlcomp.hostname | ||
if urlcomp.port: | ||
netloc += f':{urlcomp.port}' | ||
curated_baseurl = '{}://{}{}'.format(urlcomp.scheme, netloc, urlcomp.path) |
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.
An fstring would be more readable I think.
Failures are upstream server and unrelated. |
BUG: Include port number if present
This is a quick fix to address the Issue #563, by including the port number if present
in the provided URL.
The code checks if the
baseurl
has port number, and adds to the hostname incurated_baseurl
.This should fix the issue that the port number was missing as #563 described.