labrador-kennel / http-cors

Middleware for @amphp http-server to handle CORS requests!
https://labrador-kennel.io/docs/http-cors
MIT License
8 stars 7 forks source link

Do not handle requests with no Origin header #23

Closed cspray closed 4 years ago

cspray commented 4 years ago

Going through the ConfigurationLoader process and the necessary logic to determine if CORS headers should be added for a Response if no Origin header is present doesn't make sense. We know before any of the processing that an Origin header with no value will never match any of our expected logic and we can skip over this potentially costly step for requests that do not require it.

cspray commented 4 years ago

@enumag Going to merge this in along with the header case sensitivity fixes and plan to release 0.3 version today/tomorrow.