cyu / rack-cors

Rack Middleware for handling Cross-Origin Resource Sharing (CORS), which makes cross-origin AJAX possible.
MIT License
3.26k stars 263 forks source link

[Quick Question] Is this a valid way to use wildcards in a configuration? #232

Closed dep closed 2 years ago

dep commented 2 years ago

To allow ports 3000 - 3009:

allow do
  if !Rails.env.production?
    origins "http://localhost:300*"
    resource '*',
    headers: :any,
    methods: [:post],
    credentials: true
  end
end
sandstrom commented 2 years ago

I'd suggest closing this PR and open up the discussions tab on this repository. Then move questions like this to discussions.

cyu commented 2 years ago

@dep you should match origin using regular expressions instead.