diff --git a/app/controllers/api/v1/follows_controller.rb b/app/controllers/api/v1/follows_controller.rb
index f688f2e72c12bf45433be7f12e250b94b85f98a9..739ac1fb1f9f6bf6297de41ffe42597c02e35eb9 100644
--- a/app/controllers/api/v1/follows_controller.rb
+++ b/app/controllers/api/v1/follows_controller.rb
@@ -5,7 +5,7 @@ class Api::V1::FollowsController < ApiController
   def create
     raise ActiveRecord::RecordNotFound if params[:uri].blank?
 
-    @account = FollowService.new.call(current_user.account, params[:uri]).try(:target_account)
+    @account = FollowService.new.call(current_user.account, params[:uri].strip).try(:target_account)
     render action: :show
   end
 end
diff --git a/app/lib/tag_manager.rb b/app/lib/tag_manager.rb
index 4d29ca1f8b05bbcb3b34579fc08f6bb539b1205d..ad76d10c47c5a2d55d12356709f8f2611c48307c 100644
--- a/app/lib/tag_manager.rb
+++ b/app/lib/tag_manager.rb
@@ -17,6 +17,10 @@ class TagManager
     id.start_with?("tag:#{Rails.configuration.x.local_domain}")
   end
 
+  def local_domain?(domain)
+    domain.nil? || domain.gsub(/[\/]/, '') == Rails.configuration.x.local_domain
+  end
+
   def uri_for(target)
     return target.uri if target.respond_to?(:local?) && !target.local?
 
diff --git a/app/services/follow_remote_account_service.rb b/app/services/follow_remote_account_service.rb
index 9fbf17091d2e7e303b486226cb7a943df2d11dfe..3b305504c1c12ce950cee401ef58434967968117 100644
--- a/app/services/follow_remote_account_service.rb
+++ b/app/services/follow_remote_account_service.rb
@@ -7,7 +7,7 @@ class FollowRemoteAccountService < BaseService
   def call(uri)
     username, domain = uri.split('@')
 
-    return Account.find_local(username) if domain == Rails.configuration.x.local_domain || domain.nil?
+    return Account.find_local(username) if TagManager.instance.local_domain?(domain)
 
     account = Account.find_remote(username, domain)
 
diff --git a/app/services/process_feed_service.rb b/app/services/process_feed_service.rb
index 9585b15ddc868c538397d773ba6ab403707e8a06..d24b803e6490f5be300b976e4009b23071b8703c 100644
--- a/app/services/process_feed_service.rb
+++ b/app/services/process_feed_service.rb
@@ -63,7 +63,7 @@ class ProcessFeedService < BaseService
 
       href = Addressable::URI.parse(href_val)
 
-      if href.host == Rails.configuration.x.local_domain
+      if TagManager.instance.local_domain?(href.host)
         # A local user is mentioned
         mentioned_account = Account.find_local(href.path.gsub('/users/', ''))