Ignore HEAD method if does not support (#5949)

lolsob-rspec
Yamagishi Kazutoshi 2017-12-10 00:53:40 +09:00 committed by Eugen Rochko
parent 2a8ab39a06
commit f54ca825c5
1 changed files with 1 additions and 1 deletions

View File

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