theelous3 / asks

Async requests-like httplib for python.
MIT License
508 stars 63 forks source link

Duplicate path in response.url #50

Closed Kilavagora closed 6 years ago

Kilavagora commented 7 years ago

OK, now I am getting the odd URLs from

response = await session.get(initial_url_that_will_redirect)
print(response.url)
https://example.com/identity/login?signin=61a17533a7d449728bb90790e31dc186/identity/login?signin=61a17533a7d449728bb90790e31dc186'

The issue seems comes from here: https://github.com/theelous3/asks/blob/e1ecb403e05d30222b8ab124822e236e414be139/asks/request_object.py#L530

Perhaps, self.host should be defined and the line should be something like:

'url': self.host + self.path
theelous3 commented 7 years ago

Yeah, I sort of bashed that in as a placeholder. Sometimes a url is given that ends in /, and a path is given that starts with /, resulting in a url with // halfway.

Just need to write a slightly more verbose check for that.

Could you clarify, by use of your great edge-case finding brain, if the other issue is solved?

theelous3 commented 7 years ago

Fixed in https://github.com/theelous3/asks/commit/b078ac70545b17432156cf5aaddb668ea62ecd89

Kilavagora commented 7 years ago

For the above, I am getting URL that is missing https:// now:

example.com/identity/login?signin=61a17533a7d449728bb90790e31dc186
theelous3 commented 7 years ago

Updated in https://github.com/theelous3/asks/commit/5b225abb60e6fefbf644efa3eb7040b7b52f07c4