theelous3 / asks

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

Fix redirection bug where Location header contains a relative URL #148

Closed dahlia closed 4 years ago

dahlia commented 4 years ago

This fixes #131. This fixes a bug that if Location header has a relative URL which consists of . or .. redirection is mishandled. I also added a test case to reproduce the bug.

Also there was a bug that UnboundLocalError had risen when Session.request() method got unknown keyword arguments, so I fixed this as well. I believe this bug was made at 32fcedcd7d0019007d50d4e18268b340f5776c72.

theelous3 commented 4 years ago

Hey, nice thanks. The kwargs thing was fixed in another PR that was pending, so you can just drop that commit.

dahlia commented 4 years ago

@theelous3 I dropped the redundant commit and rebased this pull request on the current master.

theelous3 commented 4 years ago

Thanks! If you don't mind me asking, how did you find using overly for that test case? (The http test lib I wrote for asks' tests).

Would love some feedback on it.

dahlia commented 4 years ago

Thanks for merging.

At a first glance, I didn't get how it works and how to use it, so just copied other test cases, and tinkered things on that. As I didn't understand what “steps” are, I read the overly/steps.py code as well.