From 72484a194fb5f52cf2512a95045fc6bd2d3e2ef4 Mon Sep 17 00:00:00 2001
From: Matt Jankowski <matt@jankowski.online>
Date: Fri, 21 Jun 2024 11:32:49 -0400
Subject: [PATCH] Remove `CacheBuster` default options (#30718)

---
 app/lib/cache_buster.rb       | 9 ++-------
 spec/lib/cache_buster_spec.rb | 8 --------
 2 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/app/lib/cache_buster.rb b/app/lib/cache_buster.rb
index 554f2ba95..d3395f8f0 100644
--- a/app/lib/cache_buster.rb
+++ b/app/lib/cache_buster.rb
@@ -2,13 +2,8 @@
 
 class CacheBuster
   def initialize(options = {})
-    Rails.application.deprecators[:mastodon].warn('Default values for the cache buster secret header name and values will be removed in Mastodon 4.3. Please set them explicitely if you rely on those.') unless options[:http_method] || (options[:secret] && options[:secret_header])
-
-    @secret_header = options[:secret_header] ||
-                     (options[:http_method] ? nil : 'Secret-Header')
-    @secret = options[:secret] ||
-              (options[:http_method] ? nil : 'True')
-
+    @secret_header = options[:secret_header]
+    @secret = options[:secret]
     @http_method = options[:http_method] || 'GET'
   end
 
diff --git a/spec/lib/cache_buster_spec.rb b/spec/lib/cache_buster_spec.rb
index 78ca18349..84085608e 100644
--- a/spec/lib/cache_buster_spec.rb
+++ b/spec/lib/cache_buster_spec.rb
@@ -28,14 +28,6 @@ describe CacheBuster do
     end
 
     context 'when using default options' do
-      around do |example|
-        # Disables the CacheBuster.new deprecation warning about default arguments.
-        # Remove this `silence` block when default arg support is removed from CacheBuster
-        Rails.application.deprecators[:mastodon].silence do
-          example.run
-        end
-      end
-
       include_examples 'makes_request'
     end