An update to Chrome in the past few days is causing some of the API calls from my SPA (Backbone.js) to my server (Node.js running Hapi) to be blocked with a CORB error. I am doing prototyping so no authentication is currently in place.
In backbone I am using the model url property and I do not see a way to specify header and payload type.
url: function () {
return 'http://localhost:4000/api/getSpotPrices/' + energy.type);
}
Do I need to change settings in Hapi to prevent this from occurring?
[Update] I added a CORS setting to my Hapi configuration and set it to wildcard:
server.route({
config: {
cors: {
origin: ['*']
}
},
method: 'GET',
etc...
}
And now Chrome throws the error:
The 'Access-Control-Allow-Origin' header contains multiple values 'http://localhost:63342, *', but only one is allowed.
So, without the CORS configuration CORB blocks my service call. With the CORS configuration setting CORS complains about too many entries in the header entry.