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 BethGriggs committed Oct 13, 2020
1 parent 1610728 commit 7092756
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/_http_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,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 7092756

Please sign in to comment.