Configure CORS headers for submission endpoint

This commit is contained in:
2020-04-06 00:01:11 +02:00
parent d10ba13735
commit d344256013
3 changed files with 10 additions and 0 deletions

View File

@@ -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