Skip to content

Commit

Permalink
lib: change http client path assignment
Browse files Browse the repository at this point in the history
- change http client path assignment from  to  (it's more
appropriate in this case).
- since the inner condition is the only referencing the variable, moved
the assignment to the inner condition.

PR-URL: #35508
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
  • Loading branch information
dekinderfiets authored and MylesBorins committed Nov 16, 2020
1 parent 48bc3fc commit 6efa140
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/_http_client.js
Expand Up @@ -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');
}
Expand Down

0 comments on commit 6efa140

Please sign in to comment.