lib/onebox/engine/amazon_onebox.rb in onebox-1.5.38 vs lib/onebox/engine/amazon_onebox.rb in onebox-1.5.39

- old
+ new

@@ -9,10 +9,14 @@ matches_regexp(/^https?:\/\/(?:www)\.amazon\.(?<tld>com|ca|de|it|es|fr|co\.jp|co\.uk|cn|in|com\.br)\//) def url - return "http://www.amazon.#{tld}/gp/aw/d/" + URI::encode(match[:id]) if match && match[:id] + if match && match[:id] + _url = URI("http://www.amazon.#{tld}/gp/aw/d/" + URI::encode(match[:id])) + _url.scheme = URI(@url).scheme + return _url.to_s + end @url end def tld @tld || @@matcher.match(@url)["tld"]