mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00: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:
committed by
GitHub
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();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user