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

Cookies extraction is not working properly in 5.x #693

Closed flosacca closed 3 years ago

flosacca commented 3 years ago

In 5.0.2, HTTP::Response#cookies does not return cookies set by Set-Cookie header fields in a non-canonical form (e.g. set-cookie rather than Set-Cookie). It seems due to #576. The behavior of HTTP::Headers#each changes to yield the original field name, but HTTP::Response#cookies iterates over header fields by calling HTTP::Headers#each and only finds fields with name exactly equal to Set-Cookie.

tarcieri commented 3 years ago

It would seem this would impact all 5.x releases, not just 5.0.2?

tycooon commented 3 years ago

Yes, I saw this behavior in version 5.0.0.

tarcieri commented 3 years ago

Thanks for confirming. Seems like an easy fix if anyone would like to open a PR.