0
0
Fork 0

Fixed Rails route covering %40-encoded profile URL paths to not 404 (#31184)

This commit is contained in:
Tim Rogers 2024-07-30 03:18:00 -05:00 committed by GitHub
parent 7d11a6c9b0
commit 2ce99c51dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 106 additions and 1 deletions

View file

@ -142,7 +142,11 @@ Rails.application.routes.draw do
resource :inbox, only: [:create], module: :activitypub
get '/:encoded_at(*path)', to: redirect('/@%{path}'), constraints: { encoded_at: /%40/ }
constraints(encoded_path: /%40.*/) do
get '/:encoded_path', to: redirect { |params|
"/#{params[:encoded_path].gsub('%40', '@')}"
}
end
constraints(username: %r{[^@/.]+}) do
with_options to: 'accounts#show' do