Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
dekinderfiets committed Oct 5, 2020
commit f5c4a56f59f74ec223446fb5b44a95209f5b3878
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