ruby: fix cors

This commit is contained in:
Alexandr Fedorov
2021-01-31 16:02:57 +03:00
parent 930338f5fc
commit 9ed7b0e96e
3 changed files with 15 additions and 0 deletions

View File

@ -44,3 +44,5 @@ end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'uuid'
gem 'rack-cors'

View File

@ -102,6 +102,7 @@ GEM
nokogiri (1.10.10-x64-mingw32)
mini_portile2 (~> 2.4.0)
rack (2.2.3)
rack-cors (1.1.1)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (6.0.3.3)
@ -186,6 +187,7 @@ DEPENDENCIES
coffee-rails (~> 5.0.0)
jbuilder (~> 2.9.1)
jquery-rails
rack-cors
rails (= 6.0.3.3)
sass-rails (~> 6.0)
sdoc (~> 0.4.0)

View File

@ -2,3 +2,14 @@
require ::File.expand_path('../config/environment', __FILE__)
run Rails.application
require 'rack/cors'
use Rack::Cors do
allow do
origins '*'
resource '*',
:headers => :any,
:methods => [:get]
end
end