mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 06:34:05 -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',
|
||||
);
|
||||
}
|
||||
|
||||
if (req.method === 'OPTIONS') {
|
||||
res.writeHead(204).end();
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue