Skip to content

Update http dependency to > 4.3 - #13

Open
jrmhaig wants to merge 1 commit into
amrfaissal:masterfrom
jrmhaig:update_http
Open

Update http dependency to > 4.3#13
jrmhaig wants to merge 1 commit into
amrfaissal:masterfrom
jrmhaig:update_http

Conversation

@jrmhaig

@jrmhaig jrmhaig commented Apr 15, 2021

Copy link
Copy Markdown

We are using this gem and have identified an intermittent fault after upgrading to Ruby 2.7. The http gem is pinned to version 3 but Ruby 2.7 support was added with version 4.3.0.

I have a test to demonstrate:

require 'googlemaps/services/client'

include GoogleMaps::Services

key = '<add your API key here>'
origin = 'SW1A 1AA'
destination = 'SW1A 2AA'

c = GoogleClient.new(key: key, response_format: :json)
params = { 'origin' => origin, 'destination' => destination, 'region' => 'uk', 'alternatives' => true }

10.times do |i|
  response = c.request(url: '/maps/api/directions/json', params: params)
end

At some point you get a can't modify frozen String: "" (FrozenError) error at http-3.3.0/lib/http/response/body.rb:52. This is resolved with version 4.3 or later of http.

The http gem added support for Ruby 2.7 with version 4.3.
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 97.917% when pulling 46856ac on jrmhaig:update_http into 77e8d19 on amrfaissal:master.

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.

2 participants