From e3fb528d123d7d56f3bb669634a18de358c87073 Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Mon, 4 Jun 2018 20:42:53 +0900 Subject: [PATCH] Skip processing when HEAD method returns 501 (#7730) --- app/services/fetch_link_card_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/fetch_link_card_service.rb b/app/services/fetch_link_card_service.rb index 86d0f9971..560a81768 100644 --- a/app/services/fetch_link_card_service.rb +++ b/app/services/fetch_link_card_service.rb @@ -40,7 +40,7 @@ class FetchLinkCardService < BaseService @card ||= PreviewCard.new(url: @url) failed = Request.new(:head, @url).perform do |res| - res.code != 405 && (res.code != 200 || res.mime_type != 'text/html') + res.code != 405 && res.code != 501 && (res.code != 200 || res.mime_type != 'text/html') end return if failed