mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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: https://github.com/nodejs/node/pull/35508 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
This commit is contained in:
committed by
Node.js GitHub Bot
parent
4e9f3cc6fe
commit
f512ce6aa0
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user