0
0
Fork 0

Refactor monkey-patching of Goldfinger (#12561)

This commit is contained in:
Eugen Rochko 2020-05-10 11:41:43 +02:00 committed by GitHub
parent 4a2ea2e51b
commit 4b766f9846
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 40 additions and 20 deletions

View file

@ -3,6 +3,7 @@
class ResolveAccountService < BaseService
include JsonLdHelper
include DomainControlHelper
include WebfingerHelper
class WebfingerRedirectError < StandardError; end
@ -76,7 +77,7 @@ class ResolveAccountService < BaseService
end
def process_webfinger!(uri, redirected = false)
@webfinger = Goldfinger.finger("acct:#{uri}")
@webfinger = webfinger!("acct:#{uri}")
confirmed_username, confirmed_domain = @webfinger.subject.gsub(/\Aacct:/, '').split('@')
if confirmed_username.casecmp(@username).zero? && confirmed_domain.casecmp(@domain).zero?