Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
lib: make lowerProto scope more clear
  • Loading branch information
gengjiawen committed Mar 10, 2019
commit d768c5c6f2d50968b603a8996d1c3b55f3e06b54
5 changes: 3 additions & 2 deletions lib/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,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;
Comment thread
gengjiawen marked this conversation as resolved.
rest = rest.slice(proto.length);
}
Expand Down