about summary refs log tree commit diff
path: root/app/services/verify_link_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/verify_link_service.rb')
-rw-r--r--app/services/verify_link_service.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/services/verify_link_service.rb b/app/services/verify_link_service.rb
index d049b52d1..707aeb4e0 100644
--- a/app/services/verify_link_service.rb
+++ b/app/services/verify_link_service.rb
@@ -10,8 +10,8 @@ class VerifyLinkService < BaseService
     return unless link_back_present?
 
     field.mark_verified!
-  rescue OpenSSL::SSL::SSLError, HTTP::Error, Addressable::URI::InvalidURIError, Mastodon::HostValidationError, Mastodon::LengthValidationError => e
-    Rails.logger.debug "Error fetching link #{@url}: #{e}"
+  rescue OpenSSL::SSL::SSLError, HTTP::Error, Addressable::URI::InvalidURIError, Mastodon::HostValidationError, Mastodon::LengthValidationError, IPAddr::AddressFamilyError => e
+    Rails.logger.debug { "Error fetching link #{@url}: #{e}" }
     nil
   end
 
@@ -19,7 +19,7 @@ class VerifyLinkService < BaseService
 
   def perform_request!
     @body = Request.new(:get, @url).add_headers('Accept' => 'text/html').perform do |res|
-      res.code != 200 ? nil : res.body_with_limit
+      res.code == 200 ? res.body_with_limit : nil
     end
   end