agrueneberg / Corser

CORS middleware for Node.js
MIT License
91 stars 11 forks source link

Fix an issue where non-matching preflight requests were not terminated. #23

Closed IamfromSpace closed 6 years ago

IamfromSpace commented 6 years ago

Came across an issue where a preflight request that did not match an allowed-origin was not ended when the endPreflightRequests flag was true.

If an OPTIONS request is not matched with endPrefilghtRequests set to true, it is unlikely that the lib user wants to handle it his/herself and it would be difficult to take any meaningful action.

Tests added,

Cheers!

agrueneberg commented 6 years ago

Good catch, thanks!