savonrb / httpi

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

Downcasing of header keys breaks bad servers #248

Closed mvz closed 4 months ago

mvz commented 5 months ago

With httpi 4.0, httpi downcases sent headers because it uses a copy of Rack's Rack::Headers class. This class downcases headers and this works fine because Rack is meant for processing incoming HTTP requests. However, since httpi is used for sending requests, this behavior breaks use cases where HTTP requests need to be sent to misbehaving servers that require a particular casing.

Please consider replacing the HTTPI::Utils::Headers implementation with the implemenation of Rack::Utils::HeadersHash from Rack 2.2.9. This implementation is case preserving and does not downcase headers.

pcai commented 5 months ago

Thanks for reporting this. Yes the reasoning for this behavior makes sense - will look into reverting the change

pcai commented 4 months ago

released as v4.0.2

mvz commented 4 months ago

Thanks @pcai, it works perfectly!