about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-02-28 15:46:29 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-02-28 15:46:29 +0100
commit47d50b0e3967f1d396bdbe8ea3e8909ce2be599f (patch)
tree07b076154cbe66f2d1a31dbb9662892fb24c8156 /app/controllers
parentf1654da7ad11920979d335798cfeef2e88118c1b (diff)
A lot of fixes from a live test
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/xrd_controller.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/xrd_controller.rb b/app/controllers/xrd_controller.rb
index 6fda75a03..417d4f4fa 100644
--- a/app/controllers/xrd_controller.rb
+++ b/app/controllers/xrd_controller.rb
@@ -19,7 +19,12 @@ class XrdController < ApplicationController
   end
 
   def username_from_resource
-    params[:resource].split('@').first.gsub('acct:', '')
+    if params[:resource].start_with?('acct:')
+      params[:resource].split('@').first.gsub('acct:', '')
+    else
+      url = Addressable::URI.parse(params[:resource])
+      url.path.gsub('/users/', '')
+    end
   end
 
   def pem_to_magic_key(public_key)