From ae667624acbdcba796921dc44c24efd362d4a49a Mon Sep 17 00:00:00 2001
From: Matt Jankowski <matt@jankowski.online>
Date: Thu, 7 Nov 2024 05:07:04 -0500
Subject: [PATCH] Use `with_options` for shared settings options in routes
 (#30847)

---
 config/routes/admin.rb | 6 ++++--
 config/routes/api.rb   | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/config/routes/admin.rb b/config/routes/admin.rb
index 3dba6fa5b..2afe57023 100644
--- a/config/routes/admin.rb
+++ b/config/routes/admin.rb
@@ -40,8 +40,10 @@ namespace :admin do
     end
   end
 
-  get '/settings', to: redirect('/admin/settings/branding')
-  get '/settings/edit', to: redirect('/admin/settings/branding')
+  with_options to: redirect('/admin/settings/branding') do
+    get '/settings'
+    get '/settings/edit'
+  end
 
   namespace :settings do
     resource :branding, only: [:show, :update], controller: 'branding'
diff --git a/config/routes/api.rb b/config/routes/api.rb
index ccdd83dec..95fdf332a 100644
--- a/config/routes/api.rb
+++ b/config/routes/api.rb
@@ -44,8 +44,10 @@ namespace :api, format: false do
       resources :list, only: :show
     end
 
-    get '/streaming', to: 'streaming#index'
-    get '/streaming/(*any)', to: 'streaming#index'
+    with_options to: 'streaming#index' do
+      get '/streaming'
+      get '/streaming/(*any)'
+    end
 
     resources :custom_emojis, only: [:index]
     resources :suggestions, only: [:index, :destroy]