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 nil here.
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 ?
Release
0.7.0has a bug which appears when trying to accessresource(eg here:@subscription_response.resource) at one point when response headers arenilhere.To reproduce the bug in release
0.6.0you 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.0realease even if the'Content-Type'isnilit'll be transformedto_sand theunlesscondition will never be trigered so technically this issue should have been handled in the0.6.0release.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 ?