cors-psr7
cors-psr7 copied to clipboard
Small misleading in init factory method
Trying to setup package in PHP-DI container and seems like I've found small mistake in init method.
https://github.com/neomerx/cors-psr7/blob/0f968523b0b8215540915464aed08c5c4a4bf8b5/src/Strategies/Settings.php#L158-L159
Second setAllowedOrigins([]) overwrites areAllOriginsAllowed to false value, then enableAllOriginsAllowed() makes no sense one line before.
It took me quite some time before I notice that setAllowedOrigins sets areAllOriginsAllowed back to false.
Removing that line would make it more intuitive.
It is more like a sample of available options. Same for a few methods below. I will leave only the version that keep backwards compatibility in the next version.
Released in https://github.com/neomerx/cors-psr7/releases/tag/3.0.0