]> cat aescling's git repositories - mastodon.git/commitdiff
Redirect user profile page to short URL when HTML format (#4328)
authorYamagishi Kazutoshi <ykzts@desire.sh>
Mon, 24 Jul 2017 06:46:29 +0000 (15:46 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Mon, 24 Jul 2017 06:46:29 +0000 (08:46 +0200)
config/routes.rb

index 072ef798410439ea930ea13cea98b58fbe88d909..ddb4a5b9e25e8d8c78a44a2dd057b89cb4b890e4 100644 (file)
@@ -26,7 +26,7 @@ Rails.application.routes.draw do
     confirmations:      'auth/confirmations',
   }
 
-  get '/users/:username', to: redirect('/@%{username}'), constraints: lambda { |req| req.format.nil? }
+  get '/users/:username', to: redirect('/@%{username}'), constraints: lambda { |req| req.format.nil? || req.format.html? }
 
   resources :accounts, path: 'users', only: [:show], param: :username do
     resources :stream_entries, path: 'updates', only: [:show] do