Removed head request in FetchLinkCardService

This commit is contained in:
mgabdev 2019-08-26 21:57:11 -04:00
parent e6f9b0d402
commit 32b04999b1

View File

@ -39,12 +39,6 @@ class FetchLinkCardService < BaseService
def process_url
@card ||= PreviewCard.new(url: @url)
failed = Request.new(:head, @url).perform do |res|
res.code != 405 && res.code != 501 && (res.code != 200 || res.mime_type != 'text/html')
end
return if failed
Request.new(:get, @url).perform do |res|
if res.code == 200 && res.mime_type == 'text/html'
@html = res.body_with_limit