From 47d50b0e3967f1d396bdbe8ea3e8909ce2be599f Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 28 Feb 2016 15:46:29 +0100 Subject: A lot of fixes from a live test --- app/controllers/xrd_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'app/controllers') 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) -- cgit