Closed jaszczw closed 7 years ago
I see, thank you. I'm actually using this library only behind express with cors middle-ware so I didn't come to this...
Shouldn't the options be responded then for all routes?
Maybe this regexp would do it
this.router.options('/.*', function (req, res) {
res.end();
});
I have made update to pull-request: You are right the /.*
is more generic and fits perfectly here. Thanks for feedback.
I'm now missing a comment on your https://github.com/pofider/node-simple-odata-server/pull/21/commits/9b4035eca7e40ec4b65a9aba7028408c3272f941 commit
Yeah, sorry about that - i am using my master branch in job and here I have done pull-request directly from it.
The /.* didn't work as there was pathToRegex transformation done on it and I couldn't grasp how exactly I would have to write it in order for it to work, as I had limited amount of time to work on that issue I had just reverted the changes to what I knew worked.
Ok, thanks for info, I'll take a look
Thank you for your hints. Release 0.3.0 has cors config https://github.com/pofider/node-simple-odata-server#cors
This solves issue when you try to make a CORS request from browser, headers still need to be handled on the user side, but it won't throw stating that such endpoint doesn't not exist.
Feel free to discard if you have had reasons for doing it such way.