about summary refs log tree commit diff
path: root/config
diff options
context:
space:
mode:
authorThijs Kinkhorst <thijs@kinkhorst.com>2023-02-14 19:05:57 +0100
committerGitHub <noreply@github.com>2023-02-14 19:05:57 +0100
commitd15a9df6fefd515e8c655b1a03f08d2a95675d97 (patch)
tree98e1eb4a1dbefc5680f55a8efc024eb363c82cbe /config
parent66f715550e575129e5d8b093a15aa67527136bd2 (diff)
Fix paths with url-encoded @ to redirect to the correct path (#23593)
Diffstat (limited to 'config')
-rw-r--r--config/routes.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/config/routes.rb b/config/routes.rb
index 319f0c7d1..e7c4c000e 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