refactor: Delete a lot of unused and duplicate code in Server and WebhookServer (#5080)
* store n8n version string in a const and use that everywhere * reduce code duplication between Server and WebhookServer * unify redis checks * fix linting
This commit is contained in:
committed by
GitHub
parent
b67f803cbe
commit
8b19fdd5f0
@@ -1,8 +1,7 @@
|
||||
import { inDevelopment } from '@/constants';
|
||||
import type { RequestHandler } from 'express';
|
||||
|
||||
export const corsMiddleware: RequestHandler = (req, res, next) => {
|
||||
if (inDevelopment && 'origin' in req.headers) {
|
||||
if ('origin' in req.headers) {
|
||||
// Allow access also from frontend when developing
|
||||
res.header('Access-Control-Allow-Origin', req.headers.origin);
|
||||
res.header('Access-Control-Allow-Credentials', 'true');
|
||||
|
||||
Reference in New Issue
Block a user