mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(core): CORS middleware should not process the entire handler chain on OPTIONS requests (no-changelog) (#5368)
fix(core): CORS middleware should not process the entire handler chain on OPTIONS requests
This commit is contained in:
parent
e4458b48e0
commit
a115baa1ac
|
@ -11,5 +11,10 @@ export const corsMiddleware: RequestHandler = (req, res, next) => {
|
||||||
'Origin, X-Requested-With, Content-Type, Accept, sessionid',
|
'Origin, X-Requested-With, Content-Type, Accept, sessionid',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
next();
|
|
||||||
|
if (req.method === 'OPTIONS') {
|
||||||
|
res.writeHead(204).end();
|
||||||
|
} else {
|
||||||
|
next();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue