From 87c045854af6f0ed463b534a73e8436f6edccfcc Mon Sep 17 00:00:00 2001 From: Rodney Rehm Date: Wed, 20 Aug 2014 13:43:08 +0200 Subject: [PATCH] simplify authority range detection --- src/URI.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/URI.js b/src/URI.js index dfca68e0..542a1e8f 100644 --- a/src/URI.js +++ b/src/URI.js @@ -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