Skip to content

Commit

Permalink
lib: make lowerProto scope more clear
Browse files Browse the repository at this point in the history
PR-URL: nodejs#26562
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
gengjiawen authored and danbev committed Mar 15, 2019
1 parent ccdaa43 commit 169b7f1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,11 @@ Url.prototype.parse = function parse(url, parseQueryString, slashesDenoteHost) {
}
}

var proto = protocolPattern.exec(rest);
let proto = protocolPattern.exec(rest);
let lowerProto;
if (proto) {
proto = proto[0];
var lowerProto = proto.toLowerCase();
lowerProto = proto.toLowerCase();
this.protocol = lowerProto;
rest = rest.slice(proto.length);
}
Expand Down

0 comments on commit 169b7f1

Please sign in to comment.