Normalize response headers for http.rb and wget backends #68
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.