Skip to content

Commit 6efa140

Browse files
dekinderfietsMylesBorins
authored andcommittedNov 16, 2020
lib: change http client path assignment
- 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>
1 parent 48bc3fc commit 6efa140

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed
 

‎lib/_http_client.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,8 @@ function ClientRequest(input, options, cb) {
141141
if (this.agent && this.agent.protocol)
142142
expectedProtocol = this.agent.protocol;
143143

144-
let path;
145144
if (options.path) {
146-
path = String(options.path);
145+
const path = String(options.path);
147146
if (INVALID_PATH_REGEX.test(path))
148147
throw new ERR_UNESCAPED_CHARACTERS('Request path');
149148
}

0 commit comments

Comments
 (0)
Please sign in to comment.