-
Notifications
You must be signed in to change notification settings - Fork 7
Replace excon with Net::HTTP to support Unzer AWS proxy #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we be 100% sure the headers are always lowercase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which is the reason for the major version change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides changes in underlying client errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't you be sleeping
No description provided.