From: Yamagishi Kazutoshi Date: Mon, 24 Jul 2017 06:46:29 +0000 (+0900) Subject: Redirect user profile page to short URL when HTML format (#4328) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=ef16089c6d32d8d6619fea28838b83136fe3b0fd;p=mastodon.git Redirect user profile page to short URL when HTML format (#4328) --- 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