Closed robinvdvleuten closed 8 years ago
Please try to provide the full code that we can run ourselves to confirm the issue. Otherwise we have to make guesses about everything you don't include and they could be incorrect guesses.
Here's a full example of the above that can be run: https://gist.github.com/mtharrison/eb771b4a2bace5a639c9
The above example doesn't give the 404 that you're reporting.
I did notice if you use a port other than 80 (such as 4000), the CORS OPTIONS request will 404. This is because the following check:
https://github.com/hapijs/call/blob/master/lib/index.js#L92
It will compare example.com (the vhost setting) with example.com:4000 (the host header). It's not possible however to set the vhost option to include a port number. I'm not sure if this is a bug or not though. /cc @hueniverse
@mtharrison ok the issue was indeed the port number not being port 80. But it looks like a bug in the if-statement then.
Sounds like a bug in how the options handler sets vhost.
I think this issue should be migrated to hapi as that's where the issue seems to lie.
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.
If I configure a vhost for routes in a plugin, the CORS options requests results in a 404 response.
It can be reproduced with the following example;
If I comment out the vhost option, the CORS response is returned as expected.