Configure CORS headers for submission endpoint
This commit is contained in:
parent
d10ba13735
commit
d344256013
1
Gemfile
1
Gemfile
@ -22,6 +22,7 @@ gem 'jbuilder'
|
||||
gem 'bootsnap', '>= 1.4.2', require: false
|
||||
|
||||
gem 'google-api-client'
|
||||
gem 'rack-cors'
|
||||
|
||||
group :development, :test do
|
||||
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
|
||||
|
@ -121,6 +121,8 @@ GEM
|
||||
puma (4.3.3)
|
||||
nio4r (~> 2.0)
|
||||
rack (2.2.2)
|
||||
rack-cors (1.1.1)
|
||||
rack (>= 2.0.0)
|
||||
rack-proxy (0.6.5)
|
||||
rack
|
||||
rack-test (1.1.0)
|
||||
@ -217,6 +219,7 @@ DEPENDENCIES
|
||||
listen
|
||||
pg
|
||||
puma
|
||||
rack-cors
|
||||
rails
|
||||
sass-rails
|
||||
spring
|
||||
|
@ -15,5 +15,11 @@ module Tinyform
|
||||
# Application configuration can go into files in config/initializers
|
||||
# -- all .rb files in that directory are automatically loaded after loading
|
||||
# the framework and any gems in your application.
|
||||
config.middleware.insert_before 0, Rack::Cors do
|
||||
allow do
|
||||
origins '*'
|
||||
resource '/s/*', headers: :any, methods: [:post, :put, :options]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user