Fixed Rails route covering %40-encoded profile URL paths to not 404 (#31184)
This commit is contained in:
parent
7d11a6c9b0
commit
2ce99c51dd
2 changed files with 106 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue