Skip to content

Commit

Permalink
simplify authority range detection
Browse files Browse the repository at this point in the history
  • Loading branch information
rodneyrehm committed Aug 20, 2014
1 parent 6d0d965 commit 87c0458
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/URI.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,11 +482,7 @@
URI.parseUserinfo = function(string, parts) {
// extract username:password
var firstSlash = string.indexOf('/');
/*jshint laxbreak: true */
var pos = firstSlash > -1
? string.lastIndexOf('@', firstSlash)
: string.indexOf('@');
/*jshint laxbreak: false */
var pos = string.lastIndexOf('@', firstSlash > -1 ? firstSlash : string.length - 1);
var t;

// authority@ must come before /path
Expand Down

0 comments on commit 87c0458

Please sign in to comment.