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
fix issue where port is not propagated down to connection URL #971
Conversation
mergey merge |
Good catch. |
@@ -163,9 +163,10 @@ class LibcloudConnection(LibcloudBaseConnection): | |||
response = None | |||
|
|||
def __init__(self, host, port, **kwargs): | |||
self.host = '{0}://{1}'.format( | |||
self.host = '{0}://{1}{2}'.format( | |||
'https' if port == 443 else 'http', |
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.
Do we have access to secure
argument here?
Because if we do, it looks like we still don't correctly handle one scenario - https on a non default port (protocol is not set correctly). For example, secure=True, port=8080 should result in https://<host>:8080
.
Or am I missing something?
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.
Edit: Sorry, I should have read the description better - you already addressed this scenario there.
Also checked the code and it looks like "secure" argument is not passed to the constructor right now so yeah, we would need to change some code to make it work.
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.
@Kami yes, absolutely. That's a separate PR. I'm back to making one change at a time!
Noticed that a custom port does not roll down properly to the connection class.
Also, there is still an outstanding issue that unless the port is 443, the connection will be assumed as plain HTTP.
E.g. setting port as 9999 but Secure=True will still issue a plain HTTP connection