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

Using [:any] doesn't work #221

Closed sjmiller609 closed 3 years ago

sjmiller609 commented 3 years ago

This is not a bug, but just want to create this issue so others can notice this if they are having trouble.

I was having some issue where my tests to check if preflight requests were returning the appropriate headers were not working. Eventually I figured out that because I specified

methods: [:any]

instead of

methods: :any

that "methods" were replaced by [:get]. It is documented in the README already to use ":any" OR an array.

Issue may be phrased as:

Headers not being returned GET working but other methods not working no preflight headers