-
Notifications
You must be signed in to change notification settings - Fork 39
Update http gem to 5.0.4 #2998
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
Update http gem to 5.0.4 #2998
Conversation
To get to a fixed version for arm m1 macs The latest version of the http gem drops http-parser for llhttp, which has broader compatibility, as well as including a whole host of other fixes in http itself. see https://github.com/httprb/http/blob/main/CHANGES.md for details re: #1969 re: httprb/http#630
HTTP has a built in parse method we can use, we just have to provide the content type that we are expecting see httprb/http#540
| http-cookie (1.0.4) | ||
| domain_name (~> 0.5) | ||
| http-form_data (2.3.0) | ||
| http-parser (1.2.1) |
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.
No more http-parser!
| return unless response.status.ok? | ||
|
|
||
| JSON.parse(response, symbolize_names: true) | ||
| response.parse(:json).deep_symbolize_keys |
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.
The http gem has a parse method built in, which works fine, we just need to tell it to parse as json.
| around do |example| | ||
| WebMock.disallow_net_connect! | ||
| example.run | ||
| WebMock.allow_net_connect! |
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.
This made tracking down spec failures easier, because our suite defaults to this being allowed for feature specs to work.
This is to upgrade to a version that works with M1 ARM macs.
The latest version of the http gem drops
http-parserforllhttp, which has broader compatibility and works fine out of the box on ARM. The 5.0.4 version ofhttpalso includes many other fixes that we should update for.See https://github.com/httprb/http/blob/main/CHANGES.md for details on the update. This requires one small change in our Exotel API calls to properly handle JSON responses -- otherwise the rest of the changes are spec changes.
(this is probably the better alternative to #2997, because we should be on the latest version of the http gem anyways)
/cc @abnios
re: #1969
re: httprb/http#630