Skip to content

Commit

Permalink
Allow to pass multiple origins for cross site requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Lubosky committed Sep 2, 2024
1 parent 64eb03c commit 5393b47
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(",")

Check failure on line 26 in config/application.rb

View workflow job for this annotation

GitHub Actions / lint

Lint/AmbiguousOperator: Ambiguous splat operator. Parenthesize the method arguments if it's surely a splat operator, or add a whitespace to the right of the `*` if it should be a multiplication.
resource "*",
headers: :any,
methods: %i[get options]
Expand Down

0 comments on commit 5393b47

Please sign in to comment.