FIX: return an empty result if response from Amazon is missing expected attributes (#13173)

* FIX: return an empty result if response from Amazon is missing attributes

Check we have the basic attributes requires to construct a Onebox for Amazon.

This is an attempt to handle scenarios where we receive a valid 200-status response from an Amazon request that does not include the data we’re expecting.

* Update lib/onebox/engine/amazon_onebox.rb

Co-authored-by: Régis Hanol <regis@hanol.fr>

Co-authored-by: Régis Hanol <regis@hanol.fr>
This commit is contained in:
jbrw
2021-06-01 16:23:18 -04:00
committed by GitHub
parent 41ee5b7c86
commit 461a2c334b
6 changed files with 104 additions and 2 deletions

View File

@ -40,6 +40,11 @@ module Onebox
engine.data
end
def verified_data
return {} unless engine
engine.verified_data
end
def options
OpenStruct.new(@options)
end