gearheads
/
mastodon
Archived
2
0
Fork 0

Fix paths with url-encoded @ to redirect to the correct path (#23593)

gh/stable
Thijs Kinkhorst 2023-02-14 19:05:57 +01:00 committed by Claire
parent 3f2e31800e
commit 40ae8d5e03
1 changed files with 2 additions and 0 deletions

View File

@ -110,6 +110,8 @@ Rails.application.routes.draw do
resource :inbox, only: [:create], module: :activitypub resource :inbox, only: [:create], module: :activitypub
get '/:encoded_at(*path)', to: redirect("/@%{path}"), constraints: { encoded_at: /%40/ }
constraints(username: /[^@\/.]+/) do constraints(username: /[^@\/.]+/) do
get '/@:username', to: 'accounts#show', as: :short_account get '/@:username', to: 'accounts#show', as: :short_account
get '/@:username/with_replies', to: 'accounts#show', as: :short_account_with_replies get '/@:username/with_replies', to: 'accounts#show', as: :short_account_with_replies