diff --git a/Gemfile b/Gemfile index 377f213a0..8c0e172c7 100644 --- a/Gemfile +++ b/Gemfile @@ -25,6 +25,8 @@ gem 'turbolinks', '~> 5' # gem 'jbuilder', '~> 2.5' # Use Redis adapter to run Action Cable in production gem 'redis', '~> 4.0' +# CORS support +gem 'rack-cors' # Use ActiveModel has_secure_password # gem 'bcrypt', '~> 3.1.7' diff --git a/Gemfile.lock b/Gemfile.lock index f2f74f906..344bc1684 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -284,6 +284,10 @@ GEM nio4r (~> 2.0) raabro (1.4.0) rack (2.2.3) + rack-cors (1.1.1) + rack (>= 2.0.0) + rack-protection (2.0.8.1) + rack rack-test (1.1.0) rack (>= 1.0, < 3) rails (5.2.4.4) @@ -477,6 +481,7 @@ DEPENDENCIES omniauth-mlh (~> 0.4.1) omniauth-rails_csrf_protection puma (~> 4.3) + rack-cors rails (~> 5.2.4.4) rails-controller-testing rails-settings-cached (~> 0.7.2) diff --git a/config/initializers/cors.rb b/config/initializers/cors.rb new file mode 100644 index 000000000..054f8b2b3 --- /dev/null +++ b/config/initializers/cors.rb @@ -0,0 +1,6 @@ +Rails.application.config.middleware.insert_before 0, Rack::Cors do + allow do + origins '*' + resource '*/events.json', headers: :any, methods: [:get] # Workaround for now + end +end diff --git a/vendor/cache/rack-cors-1.1.1.gem b/vendor/cache/rack-cors-1.1.1.gem new file mode 100644 index 000000000..d0b77079e Binary files /dev/null and b/vendor/cache/rack-cors-1.1.1.gem differ diff --git a/vendor/cache/tzinfo-1.2.8.gem b/vendor/cache/tzinfo-1.2.8.gem deleted file mode 100644 index f24bf8e1e..000000000 Binary files a/vendor/cache/tzinfo-1.2.8.gem and /dev/null differ