0
0
Fork 0

Allow alternate domains for mastodon handlers (#3187)

This commit is contained in:
Immae 2017-05-22 15:40:04 +02:00 committed by Eugen Rochko
parent 9d04de1c8d
commit a94c152fd3
4 changed files with 41 additions and 1 deletions

View file

@ -23,7 +23,14 @@ module WellKnown
private
def username_from_resource
WebfingerResource.new(resource_param).username
resource_user = resource_param
username, domain = resource_user.split('@')
if Rails.configuration.x.alternate_domains.include?(domain)
resource_user = "#{username}@#{Rails.configuration.x.local_domain}"
end
WebfingerResource.new(resource_user).username
end
def pem_to_magic_key(public_key)