fruitcake / laravel-cors

Adds CORS (Cross-Origin Resource Sharing) headers support in your Laravel application
MIT License
6.27k stars 613 forks source link

Memory Leaks in Octane #527

Closed themsaid closed 3 years ago

themsaid commented 3 years ago

This line creates a memory leak in Octane: https://github.com/fruitcake/laravel-cors/blob/5781ffce1f68cb003a36ddd1c66fcf70bae3c07d/src/HandleCors.php#L51

Event listeners should be registered inside a service provider. Doing this inside a middleware causes the listener to be registered multiple times one on each request.

barryvdh commented 3 years ago

Fixed with #469