From 5137c80c07d8a0781e585d35c86b58252663907e Mon Sep 17 00:00:00 2001 From: Bert Verhelst Date: Sat, 9 Oct 2021 21:51:24 +0200 Subject: [PATCH] fix(monitor): handle empty headers --- server/model/monitor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index 2738898f..e2029c5e 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -148,10 +148,10 @@ class Monitor extends BeanModel { headers: { "Accept": "*/*", "User-Agent": "Uptime-Kuma/" + version, - ...JSON.parse(this.headers), + ...(this.headers ? JSON.parse(this.headers) : {}), }, httpsAgent: new https.Agent({ - maxCachedSessions: 0, // Use Custom agent to disable session reuse (https://github.com/nodejs/node/issues/3940) + maxCachedSessions: 0, // Use "{}"om agent to disable session reuse (https://github.com/nodejs/node/issues/3940) rejectUnauthorized: ! this.getIgnoreTls(), }), maxRedirects: this.maxredirects,