We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
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.
res.removeHeader('Allow');
Any suggestions?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I try to enable CORS via middleware option by adding extra headers to the response. My code for this is:
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?
The text was updated successfully, but these errors were encountered: