http icon indicating copy to clipboard operation
http copied to clipboard

Redirections to other domains break persistent client

Open tycooon opened this issue 5 years ago • 1 comments

client = HTTP.persistent("https://example.com").follow
client.get(some_url)

In case some_url redirects to some domain other than example.com, we get the HTTP::StateError: Persistence is enabled for https://example.com, but we got https://some-other-domain.com.

tycooon avatar Jun 26 '19 14:06 tycooon

Yeah, that's unfortunate. Redirection and persistence atm are conflicting when used at the same time. That should be solved by introducing HTTP::Session class that will keep pool of persistent-clients per-URI and will properly handle redirections and cookie management.

ixti avatar Jun 26 '19 19:06 ixti