From 4ef17d1af528a7ceefa4b1ca5caf239a421a9e35 Mon Sep 17 00:00:00 2001 From: Tobias Becht Date: Thu, 9 Feb 2023 11:48:37 +0100 Subject: [PATCH] fix: handle 'missing' options --- www/helpers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/helpers.js b/www/helpers.js index ed070fe..a379394 100644 --- a/www/helpers.js +++ b/www/helpers.js @@ -498,7 +498,7 @@ module.exports = function init(global, jsUtil, cookieHandler, messages, base64, function handleMissingOptions(options, globals) { options = options || {}; - return { + return Object.assign({}, options, { data: jsUtil.getTypeOf(options.data) === 'Undefined' ? null : options.data, filePath: options.filePath, followRedirect: checkFollowRedirectValue(options.followRedirect || globals.followRedirect), @@ -511,6 +511,6 @@ module.exports = function init(global, jsUtil, cookieHandler, messages, base64, connectTimeout: checkTimeoutValue(options.connectTimeout || globals.connectTimeout), readTimeout: checkTimeoutValue(options.readTimeout || globals.readTimeout), timeout: checkTimeoutValue(options.timeout || globals.timeout) - }; + }); } };