jdesrosiers / silex-cors-provider

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

The CorsServiceProvider has a couple weaknesses #1

Closed jdesrosiers closed 7 years ago

jdesrosiers commented 11 years ago

The CorsServiceProvider has a couple weaknesses. 1. It generates OPTIONS routes even if OPTIONS routes already exist. I think this feature needs to check if the route already exists before creating one.

  1. It would probably be better if OPTIONS route generation did not happen automatically. The developer should have control over if and when this functionality is executed.
  2. The cors service allows you to apply the middleware at whatever level you choose. The idea is that one controller might have different requirements than another controller, and a third controller might not support CORS at all. The current solution covers the case where one controller uses CORS but another doesn't. The case where one controller has different CORS settings than another is difficult to express with the current architecture.
jdesrosiers commented 7 years ago

All of these have been addressed to my satisfaction.