Skip to content

Commit

Permalink
Merge pull request #3070 from bitzesty/allow-cors-array-production
Browse files Browse the repository at this point in the history
Allow to pass multiple origins for cross site requests [PRODUCTION]
  • Loading branch information
matthewford authored Sep 2, 2024
2 parents c2205d4 + 57c4837 commit 03bc2da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Application < Rails::Application
if ENV["CORS_HOST"].present?
config.middleware.insert_before 0, Rack::Cors do
allow do
origins ENV["CORS_HOST"] || "*"
origins(*(ENV["CORS_HOST"] || "*").split(","))
resource "*",
headers: :any,
methods: %i[get options]
Expand Down

0 comments on commit 03bc2da

Please sign in to comment.