r0man / ring-cors

Ring middleware for Cross-Origin Resource Sharing.
http://github.com/r0man/ring-cors
166 stars 44 forks source link

access-control-allow-origin * #9

Closed simax closed 9 years ago

simax commented 9 years ago

Hi,

Not an issue as such - I just don't know where else to ask the question - How do I tell ring-cors to allow access to all?

I currently have this

(def app
  (->
     (routes app-routes)
     (prone/wrap-exceptions)
     (handler/site)
     (wrap-cors
                :access-control-allow-origin #"http://localhost:10555"
                :access-control-allow-methods [:get :put :post :delete])
     (wrap-base-url)))

But I don't want to restrict access to "http://localhost:10555". I got errors when I used #"*" or #".*"

Any help would be appreciated.

r0man commented 9 years ago

Hi simax,

the README was out of date. Use a vector,like this

:access-control-allow-origin [#".*"]

Roman

simax commented 9 years ago

Great, thanks for the quick response.- that did the trick.