You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This block of code is preventing OPTIONS calls in the cors module from working. The cors fitting middleware is never hit because a 405 is returned in the connect middleware.
if (!operation) {
var path = runner.getPath(req);
if (!path) { return next(); }
if (!path['x-swagger-pipe']) {
var msg = util.format('Path [%s] defined in Swagger, but %s operation is not.', path.path, req.method);
var err = new Error(msg);
err.statusCode = 405;
var allowedMethods = _.map(path.operationObjects, function(operation) {
return operation.method.toUpperCase();
});
err.allowedMethods = allowedMethods;
res.setHeader('Allow', allowedMethods.sort().join(', '));
return next(err);
}
}
The text was updated successfully, but these errors were encountered:
if (!path['x-swagger-pipe'] && req.method !== 'OPTIONS') {
JADurham909
changed the title
OPTIONS requests from the browser / CORS is not working, getting 405
OPTIONS requests from the browser / CORS are not working, getting 405
Dec 21, 2015
This block of code is preventing OPTIONS calls in the cors module from working. The cors fitting middleware is never hit because a 405 is returned in the connect middleware.
The text was updated successfully, but these errors were encountered: