Removed head request in FetchLinkCardService
This commit is contained in:
parent
e6f9b0d402
commit
32b04999b1
@ -39,12 +39,6 @@ class FetchLinkCardService < BaseService
|
|||||||
def process_url
|
def process_url
|
||||||
@card ||= PreviewCard.new(url: @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|
|
Request.new(:get, @url).perform do |res|
|
||||||
if res.code == 200 && res.mime_type == 'text/html'
|
if res.code == 200 && res.mime_type == 'text/html'
|
||||||
@html = res.body_with_limit
|
@html = res.body_with_limit
|
||||||
|
Loading…
x
Reference in New Issue
Block a user