Skip to content

Conversation

@zarqman
Copy link
Contributor

@zarqman zarqman commented Feb 14, 2022

http.rb v5 changed header handling and no longer normalizes header casing for requests or responses (httprb/http#576). The wget backend also didn't normalize response headers.

The net-http backend normalizes headers already, so this PR adds the same normalization to the http.rb and wget backends.

In the case of wget, it also likely fixes detection of Content-Length and Content-Type if the upstream served those using non-normalized casing.

Strictly speaking, this could be seen as a breaking change when using the http.rb (but only with http.rb v5) or wget backends if app code was relying on the previous non-normalized casing with a particular upstream server. Such code would be fragile though, as the casing can vary based on the upstream server.

At the same time, it's also a needed bug fix since http.rb v4 and v5 behave differently, as well as the above mentioned issue with wget.

http.rb v5 changed header handling and no longer normalizes response header
casing. The wget backend also didn't normalize response headers.

This adds normalization to both, making them match the behavior of the net-http
backend, which already performed this normalization.
@jrochkind
Copy link
Collaborator

I would personally agree this is a bugfix, the previous behavior with http 5.x was a bug, so this is not a backwards breaking change.

@janko
Copy link
Owner

janko commented Feb 20, 2022

Looks good, it makes things more consistent between backends, thanks for fix!

@janko janko merged commit 97b62d3 into janko:master Feb 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants