diff options
author | Thibaut Girka <thib@sitedethib.com> | 2019-08-08 08:44:33 +0200 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2019-08-08 08:44:33 +0200 |
commit | ebc0521ba82cfc43094a1aead868c61118767030 (patch) | |
tree | afc3e03fc60c990e263e9721d3e0c6493d492d8a /app/services/resolve_account_service.rb | |
parent | 86cfa2ea6cb94c9597b9fcda034c8b4d959c5e3e (diff) | |
parent | f51c7c105f1d04520656c1235f8a5f58d256fd0e (diff) |
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'app/services/resolve_account_service.rb')
-rw-r--r-- | app/services/resolve_account_service.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/app/services/resolve_account_service.rb b/app/services/resolve_account_service.rb index 7864c4bcd..12e6544a0 100644 --- a/app/services/resolve_account_service.rb +++ b/app/services/resolve_account_service.rb @@ -60,17 +60,23 @@ class ResolveAccountService < BaseService @account = uri @username = @account.username @domain = @account.domain - @uri = [@username, @domain].compact.join('@') else - @uri = uri @username, @domain = uri.split('@') end - @domain = nil if TagManager.instance.local_domain?(@domain) + @domain = begin + if TagManager.instance.local_domain?(@domain) + nil + else + TagManager.instance.normalize_domain(@domain) + end + end + + @uri = [@username, @domain].compact.join('@') end def process_webfinger!(uri, redirected = false) - @webfinger = Goldfinger.finger("acct:#{@uri}") + @webfinger = Goldfinger.finger("acct:#{uri}") confirmed_username, confirmed_domain = @webfinger.subject.gsub(/\Aacct:/, '').split('@') if confirmed_username.casecmp(@username).zero? && confirmed_domain.casecmp(@domain).zero? |