From 40ae8d5e03167fa3d0f4c2a901285b2243d8a80b Mon Sep 17 00:00:00 2001 From: Thijs Kinkhorst Date: Tue, 14 Feb 2023 19:05:57 +0100 Subject: [PATCH] Fix paths with url-encoded @ to redirect to the correct path (#23593) --- config/routes.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/routes.rb b/config/routes.rb index cd22d1bb9..530b46a5a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -110,6 +110,8 @@ Rails.application.routes.draw do resource :inbox, only: [:create], module: :activitypub + get '/:encoded_at(*path)', to: redirect("/@%{path}"), constraints: { encoded_at: /%40/ } + constraints(username: /[^@\/.]+/) do get '/@:username', to: 'accounts#show', as: :short_account get '/@:username/with_replies', to: 'accounts#show', as: :short_account_with_replies