httprb / http

HTTP (The Gem! a.k.a. http.rb) - a fast Ruby HTTP client with a chainable API, streaming support, and timeouts
MIT License
3.01k stars 321 forks source link

Use stateful CookieJar in Redirector #613

Closed Kache closed 4 years ago

Kache commented 4 years ago

As mentioned in #264, CookieJar implements cookie domain scoping rules, which is useful when issuing redirects across domains.

Resolves: #264

tycooon commented 4 years ago

Hey guys, what's up with this PR?

tarcieri commented 4 years ago

I'd agree with @ixti it looks OK-ish for now.

I think it'd really be better to extract an HTTP::Session type out of client which deals with request state i.e. CookieJars, but otherwise this PR does address some longstanding requests.

ixti commented 4 years ago

Sorry it took me some time to get back in line but I will try to work on PRs this weekend.

ixti commented 4 years ago

I've merged this PR with some changes:

  1. reverted changes to the HTTP::Client as they were irrelevant to the scope of this PR
  2. marked Request#redirect as deprecated and reverted changes to its API
  3. moved redirected request builder into redirector.

Notice that most likely branch will fail CI. We need to upgrade test tooling. And some tests.