about summary refs log tree commit diff
path: root/app/controllers/xrd_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/xrd_controller.rb')
-rw-r--r--app/controllers/xrd_controller.rb10
1 files changed, 1 insertions, 9 deletions
diff --git a/app/controllers/xrd_controller.rb b/app/controllers/xrd_controller.rb
index ba5032abd..2886315ac 100644
--- a/app/controllers/xrd_controller.rb
+++ b/app/controllers/xrd_controller.rb
@@ -31,15 +31,7 @@ class XrdController < ApplicationController
   end
 
   def username_from_resource
-    if resource_param =~ /\Ahttps?:\/\//
-      path_params = Rails.application.routes.recognize_path(resource_param)
-      raise ActiveRecord::RecordNotFound unless path_params[:controller] == 'users' && path_params[:action] == 'show'
-      path_params[:username]
-    else
-      username, domain = resource_param.gsub(/\Aacct:/, '').split('@')
-      raise ActiveRecord::RecordNotFound unless TagManager.instance.local_domain?(domain)
-      username
-    end
+    WebfingerResource.new(resource_param).username
   end
 
   def pem_to_magic_key(public_key)