Replace excon with Net::HTTP to support Unzer AWS proxy - #48
Conversation
|
|
||
| if !options.fetch(:raw, false) && res.headers["Content-Type"] =~ CONTENT_TYPE_JSON_REGEX | ||
| res.body = JSON.parse(res.body, options[:json_opts] || @connection.data[:json_opts]) | ||
| if !options.fetch(:raw, false) && res["content-type"] =~ CONTENT_TYPE_JSON_REGEX |
There was a problem hiding this comment.
Can we be 100% sure the headers are always lowercase?
There was a problem hiding this comment.
Seems so https://github.com/ruby/net-http/blob/master/lib/net/http/header.rb#L40-L47 or at least they're treated as case-insensitive
| end | ||
| status_code = res.code.to_i | ||
| body = res.body | ||
| headers = res.each_header.to_h |
There was a problem hiding this comment.
There's a pretty big breaking change here, if we can't guarantee the headers "upper/lower-caseness".
Perhaps we could consider returning a Hash-like object that behaves like Net::HTTPHeader, because otherwise stuff might break when we or externals upgrade to version 4.
There was a problem hiding this comment.
Which is the reason for the major version change.
There was a problem hiding this comment.
Besides changes in underlying client errors
No description provided.