If Cookie.port is specified not None then CookieJar will attempt to
compare it to the port for the Request object by first parsing it out of
Request.host and if there is no port specified there falling back to
the DEFAULT_HTTP_PORT value of 80.
This caused cookies to never be sent for HTTPS domains because the
Cookie.port was set to 443, and the _FakeUrllib2Request.host did not
contain the default port value.
I've also added a test to make sure non-default port values work properly.
If Cookie.port is specified not None then CookieJar will attempt to compare it to the port for the Request object by first parsing it out of
Request.host
and if there is no port specified there falling back to theDEFAULT_HTTP_PORT
value of 80.This caused cookies to never be sent for HTTPS domains because the Cookie.port was set to 443, and the _FakeUrllib2Request.host did not contain the default port value.
I've also added a test to make sure non-default port values work properly.