feat: #158 support removing headers which were previously set via "setHeader"

This commit is contained in:
Sefa Ilkimen
2020-06-25 10:28:43 +02:00
parent 8a3bc17810
commit 3bec8dde5f
5 changed files with 19 additions and 3 deletions
+6 -1
View File
@@ -58,7 +58,12 @@ module.exports = function init(exec, cookieHandler, urlUtil, helpers, globalConf
helpers.checkForInvalidHeaderValue(value);
globalConfigs.headers[host] = globalConfigs.headers[host] || {};
globalConfigs.headers[host][header] = value;
if (value === null) {
delete globalConfigs.headers[host][header];
} else {
globalConfigs.headers[host][header] = value;
}
}
function getDataSerializer() {