From e81c9b1dadffe692ac6797fbf7e0bdba557ebfdc Mon Sep 17 00:00:00 2001 From: Alvin Smith Date: Thu, 13 Dec 2018 11:29:06 +1300 Subject: [PATCH] fix: expression minor bugs (#3074) --- lib/auth.js | 2 +- lib/har.js | 2 +- request.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/auth.js b/lib/auth.js index f5edf32c3..02f203869 100644 --- a/lib/auth.js +++ b/lib/auth.js @@ -62,7 +62,7 @@ Auth.prototype.digest = function (method, path, authHeader) { var challenge = {} var re = /([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi - for (;;) { + while (true) { var match = re.exec(authHeader) if (!match) { break diff --git a/lib/har.js b/lib/har.js index 2f660309d..0dedee444 100644 --- a/lib/har.js +++ b/lib/har.js @@ -172,7 +172,7 @@ Har.prototype.options = function (options) { req.postData.params.forEach(function (param) { var attachment = {} - if (!param.fileName && !param.fileName && !param.contentType) { + if (!param.fileName && !param.contentType) { options.formData[param.name] = param.value return } diff --git a/request.js b/request.js index 90bed4f4a..0162f4455 100644 --- a/request.js +++ b/request.js @@ -1448,7 +1448,7 @@ Request.prototype.jar = function (jar) { cookies = false self._disableCookies = true } else { - var targetCookieJar = (jar && jar.getCookieString) ? jar : globalCookieJar + var targetCookieJar = jar.getCookieString ? jar : globalCookieJar var urihref = self.uri.href // fetch cookie in the Specified host if (targetCookieJar) {