diff --git a/lib/_http_client.js b/lib/_http_client.js index 190c13846ced8f..f2639aafce324d 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -141,9 +141,8 @@ function ClientRequest(input, options, cb) { if (this.agent && this.agent.protocol) expectedProtocol = this.agent.protocol; - let path; if (options.path) { - path = String(options.path); + const path = String(options.path); if (INVALID_PATH_REGEX.test(path)) throw new ERR_UNESCAPED_CHARACTERS('Request path'); }