Fixed Rails route covering %40-encoded profile URL paths to not 404 (#31184)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user