fix issue where port is not propagated down to connection URL#971
Conversation
|
mergey merge |
|
Good catch. |
| 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.
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.
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.
@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