You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Release 0.7.0 has a bug which appears when trying to access resource (eg here: @subscription_response.resource) at one point when response headers are nilhere.
NoMethodError:
undefined method `resource' for #<Excon::Response:0x00007ff9a82d1898>
Did you mean? rescue
# .../gems/ruby-2.7.2/gems/excon-hypermedia-0.6.0/lib/excon/hypermedia/ext/response.rb:15:in `method_missing'
To reproduce the bug in release 0.6.0 you just have to change in here
From: return super unless (content_type = datum.dig(:response, :headers, 'Content-Type').to_s)
To: return super unless (content_type = datum.dig(:response, :headers, 'Content-Type').presence)
Indeed in the 0.6.0 realease even if the 'Content-Type' is nil it'll be transformed to_s and the unless condition will never be trigered so technically this issue should have been handled in the 0.6.0 release.
A possible fix might require a deeper analysis (and unit tests) but regarding the time it would involve I think it's not our priority, what do you think @oscaredel ?
The text was updated successfully, but these errors were encountered:
Release
0.7.0
has a bug which appears when trying to accessresource
(eg here:@subscription_response.resource
) at one point when response headers arenil
here.To reproduce the bug in release
0.6.0
you just have to change in hereFrom:
return super unless (content_type = datum.dig(:response, :headers, 'Content-Type').to_s)
To:
return super unless (content_type = datum.dig(:response, :headers, 'Content-Type').presence)
Indeed in the
0.6.0
realease even if the'Content-Type'
isnil
it'll be transformedto_s
and theunless
condition will never be trigered so technically this issue should have been handled in the0.6.0
release.A possible fix might require a deeper analysis (and unit tests) but regarding the time it would involve I think it's not our priority, what do you think @oscaredel ?
The text was updated successfully, but these errors were encountered: