about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-10-01 04:54:10 +0200
committerGitHub <noreply@github.com>2019-10-01 04:54:10 +0200
commit9ba40a6bfdb65f6e48eb7de07b2d55314c54fa83 (patch)
tree41aca0dca90c57db9dff523bae600e6819a5582d /app/services
parentb258583d2becfb1d1b434a2368fac627069bed0b (diff)
Remove HEAD request from fetching link previews (#12028)
It is not really necessary and we need to reduce requests
Diffstat (limited to 'app/services')
-rw-r--r--app/services/fetch_link_card_service.rb6
1 files changed, 0 insertions, 6 deletions
diff --git a/app/services/fetch_link_card_service.rb b/app/services/fetch_link_card_service.rb
index ac5503d46..f0b1169db 100644
--- a/app/services/fetch_link_card_service.rb
+++ b/app/services/fetch_link_card_service.rb
@@ -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