Closed Padam87 closed 1 year ago
I am not quite sure I understand what this is supposed to do. Can you explain a little more?
Instead of you having to specify the paths, this one does it automatically by going through the route collection.
For example if you have two routes for the /user/{id}
url, it merges the methods used into an array.
It will end up almost as the same as the path collection you can specify in yml. You can check it in the gist, the cors.cache.php
file is dumped by the cache warmer.
Then the config provider reads the rules...
The priority of this provider is 1, so the yml config takes precedence.
OK but.. is it automatically mapping all routes to allow cors on them? If so why not just allow all URLs in the config and be done with it?
This is specific. Exact methods for every route.
OK I see. Would be good to combine this with #43 to do it only for annotated routes and then it'd be quite powerful I think.
Closing as it seems nobody had any interest in pushing this further.
Hi,
I've created a small addition which automatically extracts methods from the routing, because I always forget to update the config.
I think the bundle should have a feature like this (in an opt-in version of course).
https://gist.github.com/Padam87/ad4434502de71e32626fbb4daa7f1b47
If its okay, i will submit a PR. Alernatively, we could create a command which dumps the path rules to yaml.