From 3de6dcf6343d68d695ff8087419217530019b05c Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 25 Sep 2023 15:07:10 +0200 Subject: [PATCH] Add redirection on `/deck` URLs for logged-out users (#27128) --- app/lib/permalink_redirector.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/lib/permalink_redirector.rb b/app/lib/permalink_redirector.rb index 0fcec683d96..0dd37483e23 100644 --- a/app/lib/permalink_redirector.rb +++ b/app/lib/permalink_redirector.rb @@ -14,6 +14,8 @@ class PermalinkRedirector find_account_url_by_name(first_segment) elsif accounts_request? && record_integer_id_request? find_account_url_by_id(second_segment) + elsif @path.start_with?('/deck') + @path.delete_prefix('/deck') end end @@ -52,7 +54,7 @@ class PermalinkRedirector end def path_segments - @path_segments ||= @path.delete_prefix('/').split('/') + @path_segments ||= @path.delete_prefix('/deck').delete_prefix('/').split('/') end def find_status_url_by_id(id)