r0man / ring-cors

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

Enable to use string in :access-control-request-headers #13

Closed popoppo closed 8 years ago

popoppo commented 8 years ago

Hi @r0man , thanks for your great work.

The other day I was stuck for hours with following code.

(wrap-cors handler
           ...
             :access-control-allow-headers ["Accept" "Content-Type"])

I looked over cors.clj, and figured out I should have had

             :access-control-allow-headers [:accept :content-type])

Then let me suggest allowing users to use string in :access-control-allow-headers. I believe it'd be helpful for coming users.

Thank you for your work and time.

r0man commented 8 years ago

@popoppo Could you please add some tests for this enhancement?

popoppo commented 8 years ago

I added some basic tests. Could you check that if you have time?

r0man commented 8 years ago

@popoppo Released as 0.1.8. Thanks!