From: Yamagishi Kazutoshi Date: Sat, 9 Dec 2017 15:53:40 +0000 (+0900) Subject: Ignore HEAD method if does not support (#5949) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=e7d55df38d8c18819e79646bb7d1365c5eab54f3;p=mastodon.git Ignore HEAD method if does not support (#5949) --- diff --git a/app/services/fetch_link_card_service.rb b/app/services/fetch_link_card_service.rb index cec96d927..7f4518ea7 100644 --- a/app/services/fetch_link_card_service.rb +++ b/app/services/fetch_link_card_service.rb @@ -38,7 +38,7 @@ class FetchLinkCardService < BaseService @card ||= PreviewCard.new(url: @url) res = Request.new(:head, @url).perform - return if res.code != 200 || res.mime_type != 'text/html' + return if res.code != 405 && (res.code != 200 || res.mime_type != 'text/html') attempt_oembed || attempt_opengraph end