about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYamagishi Kazutoshi <ykzts@desire.sh>2018-06-04 20:42:53 +0900
committerEugen Rochko <eugen@zeonfederated.com>2018-06-04 13:42:53 +0200
commite3fb528d123d7d56f3bb669634a18de358c87073 (patch)
treed1018073ecfd9e52b90dc5dc27f719fba054e3c1
parente0354aba7ca05c4d8bf4e19fab0cbb0ecde2950f (diff)
Skip processing when HEAD method returns 501 (#7730)
-rw-r--r--app/services/fetch_link_card_service.rb2
1 files changed, 1 insertions, 1 deletions
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