mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-11-03 20:48:07 +00:00 
			
		
		
		
	feat: Allow CORS api access (#11546)
This commit is contained in:
		@@ -14,6 +14,10 @@ Rails.application.config.middleware.insert_before 0, Rack::Cors do
 | 
			
		||||
    if ActiveModel::Type::Boolean.new.cast(ENV.fetch('CW_API_ONLY_SERVER', false)) || Rails.env.development?
 | 
			
		||||
      resource '*', headers: :any, methods: :any, expose: %w[access-token client uid expiry]
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    if ActiveModel::Type::Boolean.new.cast(ENV.fetch('ENABLE_API_CORS', false))
 | 
			
		||||
      resource '/api/*', headers: :any, methods: :any, expose: %w[access-token client uid expiry]
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user