mirror of
https://github.com/kikobar/mastodon.git
synced 2024-12-24 23:04:14 +00:00
Fix error when looking handle with surrounding spaces (#18225)
This commit is contained in:
parent
33f3818d66
commit
9a3be0ad68
|
@ -12,5 +12,7 @@ class Api::V1::Accounts::LookupController < Api::BaseController
|
|||
|
||||
def set_account
|
||||
@account = ResolveAccountService.new.call(params[:acct], skip_webfinger: true) || raise(ActiveRecord::RecordNotFound)
|
||||
rescue Addressable::URI::InvalidURIError
|
||||
raise(ActiveRecord::RecordNotFound)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -66,7 +66,7 @@ class ResolveAccountService < BaseService
|
|||
@username = @account.username
|
||||
@domain = @account.domain
|
||||
else
|
||||
@username, @domain = uri.split('@')
|
||||
@username, @domain = uri.strip.gsub(/\A@/, '').split('@')
|
||||
end
|
||||
|
||||
@domain = begin
|
||||
|
|
Loading…
Reference in a new issue