about summary refs log tree commit diff
path: root/config/routes.rb
diff options
context:
space:
mode:
authorYamagishi Kazutoshi <ykzts@desire.sh>2017-07-24 15:46:29 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-07-24 08:46:29 +0200
commitef16089c6d32d8d6619fea28838b83136fe3b0fd (patch)
tree2c9f04641ba8130afcf57cc54ebde117ca619445 /config/routes.rb
parent4b4ea1f92935ee8b32ed50dc2f4f1d091f6276f2 (diff)
Redirect user profile page to short URL when HTML format (#4328)
Diffstat (limited to 'config/routes.rb')
-rw-r--r--config/routes.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/config/routes.rb b/config/routes.rb
index 072ef7984..ddb4a5b9e 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -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