diff options
author | Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp> | 2018-03-06 03:29:36 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2018-03-05 19:29:36 +0100 |
commit | a38dbd9c8a5de4626f55d1a0dcd19ccb4a7e2c91 (patch) | |
tree | 1ac9dce407c6c65af33bff0cc25167384ae70a6a /app/controllers | |
parent | f6a8d835d30f61628ca731462ecfe4f6005e6a9e (diff) |
Redirect from Web tag timeline to public tag timeline if not signed in (#6633)
This is also implemented in Pawoo: https://github.com/pixiv/mastodon/commit/ceafdbd1bbf30fe20a2a814df0f8cae429a4e9db
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/home_controller.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 21dde20ce..b1f8f1ad9 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -34,7 +34,8 @@ class HomeController < ApplicationController end end - redirect_to(default_redirect_path) + matches = request.path.match(%r{\A/web/timelines/tag/(?<tag>.+)\z}) + redirect_to(matches ? tag_path(CGI.unescape(matches[:tag])) : default_redirect_path) end def set_initial_state_json |