diff --git a/src/models/environmentConfig.ts b/src/models/environmentConfig.ts index 2c240652..a3d6fc4f 100644 --- a/src/models/environmentConfig.ts +++ b/src/models/environmentConfig.ts @@ -4,7 +4,14 @@ import { LogLevel } from './logHandler'; import { Variables } from './variables'; export interface EnvironmentConfig { - cookieJarEnabled?: boolean; + cookieJarEnabled?: + | boolean + | { + allowSpecialUseDomain?: boolean | undefined; + looseMode?: boolean | undefined; + rejectPublicSuffixes?: boolean | undefined; + prefixSecurity?: string | undefined; + }; log?: { /** log level of outputs */ level?: LogLevel; diff --git a/src/plugins/http/cookieJarInterceptor.ts b/src/plugins/http/cookieJarInterceptor.ts index 64c1eefb..beb6fea4 100644 --- a/src/plugins/http/cookieJarInterceptor.ts +++ b/src/plugins/http/cookieJarInterceptor.ts @@ -33,7 +33,11 @@ export class CookieJarInterceptor implements HookInterceptor<[models.ProcessorCo } } options.memoryStore = memoryStore; - const jar = new CookieJar(memoryStore); + const cookieJarOptions = {}; + if (config.cookieJarEnabled !== true) { + Object.assign(cookieJarOptions, config.cookieJarEnabled); + } + const jar = new CookieJar(memoryStore, cookieJarOptions); if (request.headers && request.url) { const cookieHeader = utils.getHeader(request.headers, 'cookie'); if (cookieHeader) {