]> cat aescling's git repositories - mastodon.git/commit
Fix some failure cases on FetchLinkCardService (#5347)
authorunarist <m.unarist@gmail.com>
Thu, 12 Oct 2017 10:01:32 +0000 (19:01 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Thu, 12 Oct 2017 10:01:32 +0000 (12:01 +0200)
commit35ec1c91e3035b6d9f8998b693ff9829f101d752
tree5b662c5691408e1f9a61b09188a96d7df0b28f47
parent9d84b6e6062db19552e171c61b2647b99834d2f7
Fix some failure cases on FetchLinkCardService (#5347)

* If OEmbed response doesn't have a required property `type`, ignore it.
  e.g. `NoMethodError: undefined method 'type' for ...`
* If we failed to detect encoding, fallback to default behavior of Nokogiri.
  e.g. `KeyError: key not found: :encoding`
app/services/fetch_link_card_service.rb