Skip to content
Snippets Groups Projects
Unverified Commit 9a3be0ad authored by Claire's avatar Claire Committed by GitHub
Browse files

Fix error when looking handle with surrounding spaces (#18225)

parent 33f3818d
No related branches found
No related tags found
No related merge requests found
...@@ -12,5 +12,7 @@ class Api::V1::Accounts::LookupController < Api::BaseController ...@@ -12,5 +12,7 @@ class Api::V1::Accounts::LookupController < Api::BaseController
def set_account def set_account
@account = ResolveAccountService.new.call(params[:acct], skip_webfinger: true) || raise(ActiveRecord::RecordNotFound) @account = ResolveAccountService.new.call(params[:acct], skip_webfinger: true) || raise(ActiveRecord::RecordNotFound)
rescue Addressable::URI::InvalidURIError
raise(ActiveRecord::RecordNotFound)
end end
end end
...@@ -66,7 +66,7 @@ class ResolveAccountService < BaseService ...@@ -66,7 +66,7 @@ class ResolveAccountService < BaseService
@username = @account.username @username = @account.username
@domain = @account.domain @domain = @account.domain
else else
@username, @domain = uri.split('@') @username, @domain = uri.strip.gsub(/\A@/, '').split('@')
end end
@domain = begin @domain = begin
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment