Remove CacheBuster default options (#30718)
				
					
				
			This commit is contained in:
		
							parent
							
								
									4651c0cb39
								
							
						
					
					
						commit
						72484a194f
					
				@ -2,13 +2,8 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
class CacheBuster
 | 
					class CacheBuster
 | 
				
			||||||
  def initialize(options = {})
 | 
					  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]
 | 
				
			||||||
 | 
					    @secret = options[:secret]
 | 
				
			||||||
    @secret_header = options[:secret_header] ||
 | 
					 | 
				
			||||||
                     (options[:http_method] ? nil : 'Secret-Header')
 | 
					 | 
				
			||||||
    @secret = options[:secret] ||
 | 
					 | 
				
			||||||
              (options[:http_method] ? nil : 'True')
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @http_method = options[:http_method] || 'GET'
 | 
					    @http_method = options[:http_method] || 'GET'
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -28,14 +28,6 @@ describe CacheBuster do
 | 
				
			|||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    context 'when using default options' do
 | 
					    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'
 | 
					      include_examples 'makes_request'
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user