Skip to content

Commit

Permalink
Add fallback redirection when getting a webfinger query `WEB_DOMAIN@W…
Browse files Browse the repository at this point in the history
…EB_DOMAIN` (mastodon#28592)
  • Loading branch information
ClearlyClaire authored and noellabo committed Jun 1, 2024
1 parent 16e8f53 commit 99be966
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/controllers/well_known/webfinger_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ def show
private

def set_account
@account = Account.find_local!(username_from_resource)
username = username_from_resource
@account = begin
if username == Rails.configuration.x.local_domain || username == Rails.configuration.x.web_domain
Account.representative
else
Account.find_local!(username)
end
end
end

def username_from_resource
Expand Down

0 comments on commit 99be966

Please sign in to comment.