spec/rails_app/config/application.rb in amazon-chime-sdk-rails-1.0.0 vs spec/rails_app/config/application.rb in amazon-chime-sdk-rails-1.1.0
- old
+ new
@@ -12,10 +12,19 @@
if Rails.version.to_f >= 5.1
config.load_defaults Rails.version.to_f
end
if Rails::VERSION::MAJOR >= 6
- # Allow requests to www.example.com for RSpec
- config.hosts << 'www.example.com'
+ config.hosts.clear
+ end
+
+ # Configure CORS for public API
+ if defined?(Rack::Cors)
+ config.middleware.insert_before 0, Rack::Cors do
+ allow do
+ origins '*'
+ resource '/api/v1/public/*', methods: [:get, :delete], headers: :any
+ end
+ end
end
end
end