-
Notifications
You must be signed in to change notification settings - Fork 119
Open
Description
I try to enable CORS via middleware option by adding extra headers to the response. My code for this is:
middleware: function (connect, options, middlewares) {
middlewares.unshift(function(req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Methods', '*');
return next();
});
return middlewares;
}
This works correctly, but an extra header is being added also which makes the response invalid. The header being added is Allow: GET, HEAD, OPTIONS.
I tried to add code to the unshift method to remove this header, namely res.removeHeader('Allow');, but it does not seem to work.
Any suggestions?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels