Skip to content

Commit

Permalink
Add redirection on /deck URLs for logged-out users (mastodon#27128)
Browse files Browse the repository at this point in the history
  • Loading branch information
ClearlyClaire authored Sep 25, 2023
1 parent 38753ac commit 3de6dcf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/lib/permalink_redirector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ def redirect_path
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

Expand Down Expand Up @@ -52,7 +54,7 @@ def second_segment
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)
Expand Down

0 comments on commit 3de6dcf

Please sign in to comment.