1
0
mirror of https://github.com/glitch-soc/mastodon.git synced 2025-03-27 05:40:45 -04:00

Ignore HEAD method if does not support ()

This commit is contained in:
Yamagishi Kazutoshi 2017-12-10 00:53:40 +09:00 committed by Eugen Rochko
parent a72d03f43c
commit e7d55df38d

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