Skip processing when HEAD method returns 501 (#7730)

th-downstream
Yamagishi Kazutoshi 7 years ago committed by Eugen Rochko
parent 963b82f5e5
commit 1a145c6af1

@ -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

Loading…
Cancel
Save