From 85fcfc3c36f4b8bc635c769cd234709ddd4b475b Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Wed, 3 Feb 2021 00:23:28 +0000 Subject: [PATCH] fix(core): update --- ts/smartproxy.classes.proxyworker.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ts/smartproxy.classes.proxyworker.ts b/ts/smartproxy.classes.proxyworker.ts index cc44f7f..87900b1 100644 --- a/ts/smartproxy.classes.proxyworker.ts +++ b/ts/smartproxy.classes.proxyworker.ts @@ -8,6 +8,7 @@ export class ProxyWorker { public port = 8001; public router = new SmartproxyRouter(); public socketMap = new plugins.lik.ObjectMap(); + public defaultHeaders: {[key: string]: string} = {}; /** * starts the proxyInstance @@ -174,6 +175,9 @@ JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g= ); res.statusCode = response.statusCode; console.log(response.statusCode); + for (const defaultHeader of Object.keys(this.defaultHeaders)) { + res.setHeader(defaultHeader, this.defaultHeaders[defaultHeader]); + } for (const header of Object.keys(response.headers)) { res.setHeader(header, response.headers[header]); } @@ -270,6 +274,7 @@ const proxyWorkerCalls = { updateReverseConfigs: async (configArray: plugins.tsclass.network.IReverseProxyConfig[]) => { await proxyWorkerInstance.updateProxyConfigs(configArray); }, + addDefaultHeaders: async (headers: {[key: string]: string}) => {} }; export type TProxyWorkerCalls = typeof proxyWorkerCalls;