Use config_for for cache buster values (#34851)
				
					
				
			This commit is contained in:
		@@ -103,6 +103,7 @@ module Mastodon
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    config.x.cache_buster = config_for(:cache_buster)
 | 
			
		||||
    config.x.captcha = config_for(:captcha)
 | 
			
		||||
    config.x.mastodon = config_for(:mastodon)
 | 
			
		||||
    config.x.translation = config_for(:translation)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										5
									
								
								config/cache_buster.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								config/cache_buster.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
shared:
 | 
			
		||||
  enabled: <%= ENV.fetch('CACHE_BUSTER_ENABLED', 'false') == 'true' %>
 | 
			
		||||
  secret_header: <%= ENV.fetch('CACHE_BUSTER_SECRET_HEADER', nil) %>
 | 
			
		||||
  secret: <%= ENV.fetch('CACHE_BUSTER_SECRET', nil) %>
 | 
			
		||||
  http_method: <%= ENV.fetch('CACHE_BUSTER_HTTP_METHOD', 'GET') %>
 | 
			
		||||
@@ -1,11 +0,0 @@
 | 
			
		||||
# frozen_string_literal: true
 | 
			
		||||
 | 
			
		||||
Rails.application.configure do
 | 
			
		||||
  config.x.cache_buster_enabled = ENV['CACHE_BUSTER_ENABLED'] == 'true'
 | 
			
		||||
 | 
			
		||||
  config.x.cache_buster = {
 | 
			
		||||
    secret_header: ENV['CACHE_BUSTER_SECRET_HEADER'],
 | 
			
		||||
    secret: ENV['CACHE_BUSTER_SECRET'],
 | 
			
		||||
    http_method: ENV['CACHE_BUSTER_HTTP_METHOD'] || 'GET',
 | 
			
		||||
  }
 | 
			
		||||
end
 | 
			
		||||
		Reference in New Issue
	
	Block a user