jdesrosiers / silex-cors-provider

A silex service provider that adds CORS services to silex
MIT License
78 stars 25 forks source link

fix wrong responsed on non implemented method #5

Closed mcuadros closed 10 years ago

mcuadros commented 10 years ago

Hi,

First all, thanks for your excellent contribution.

I am using this provider at my project and i get 204 on non implemented requests, with this fix the problem is solved.

Regards and thanks again!

jdesrosiers commented 10 years ago

Thanks for finding this issue! But there is something that is bothering me. I don't think it is correct for the Allow header to include the OPTIONS method. With your changes, it looks like the route is being constructed as I would expect, but something seems to be adding the OPTIONS method even though we aren't setting it. I'm trying to track down what's going on. Any ideas?

jdesrosiers commented 10 years ago

I remembered that the Allow header is built by the Symfony RouterListener. It makes sense why it would include the OPTIONS method and there is no way it could be excluded. If including the OPTIONS method is wrong, it's a problem with Symfony, not the way the routes are constructed in this project.

Thanks for the fix.