http
http copied to clipboard
Redirections to other domains break persistent client
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
.
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.