savonrb / httpi

Common interface for Ruby's HTTP clients
http://httpirb.com
MIT License
301 stars 151 forks source link

uninitialized constant `Rack::Headers` with rack 2.x #244

Closed olly closed 7 months ago

olly commented 7 months ago

The change in https://github.com/savonrb/httpi/commit/56cd67bf0da61c39552be1d9fc9bff6f33315284 to use Rack::Headers isn't backwards compatible with Rack v2. However the gemspec still specifies compatibility with Rack v2.

In our case we upgraded savon, which in turn upgraded httpi, however rack wasn't upgraded, causing these errors.

I believe possible solutions are either to restrict the gemspec to depend on rack >= 3.0.0 or to support both the Rack::Headers and Rack::Utils::HeaderHash interfaces (as suggested in this comment).

pcai commented 7 months ago

Sorry about that - I thought I had tested this against rack 2.x but it looks like it was unintentionally loading the wrong versions and I didn't notice. I'll take a look at this today.

Yes the possible solutions at this point appear to be:

tvdeyen commented 7 months ago

We encountered the same issue after a minor version update of savon from 2.14 to 2.15. With this httpi was also updated to 4.0.0.

Fixating our Gemfile to httpi < 4 fixed this for now.

slayer commented 7 months ago

Same issue