From 14a7d1b3b2e61d9991d01789fa8a2418242202cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Tue, 25 May 2021 12:48:37 +0200 Subject: [PATCH] fix: create config should allow all options params --- src/lib/create-config.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib/create-config.ts b/src/lib/create-config.ts index 1f9754cdaa..6a136979df 100644 --- a/src/lib/create-config.ts +++ b/src/lib/create-config.ts @@ -223,6 +223,12 @@ export function createConfig(options: IUnleashOptions): IUnleashConfig { listen = { host: server.host || undefined, port: server.port }; } + const secureHeaders = + options.secureHeaders || safeBoolean(process.env.SECURE_HEADERS, false); + + const enableOAS = + options.enableOAS || safeBoolean(process.env.ENABLE_OAS, false); + return { db, session, @@ -235,8 +241,8 @@ export function createConfig(options: IUnleashOptions): IUnleashConfig { import: importSetting, experimental: experimental || {}, email, - secureHeaders: safeBoolean(process.env.SECURE_HEADERS, false), - enableOAS: safeBoolean(process.env.ENABLE_OAS, false), + secureHeaders, + enableOAS, preHook: options.preHook, preRouterHook: options.preRouterHook, eventHook: options.eventHook,