Created
April 19, 2013 15:05
-
-
Save davsclaus/5420939 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Parses the username:password from a http basic auth URL, e.g. | |
* http://foo:bar@example.com | |
*/ | |
hawtioPluginLoader.getCredentials = function(url) { | |
var uri = new Uri(url); | |
Uncaught ReferenceError: Uri is not defined | |
var credentials = uri.userInfo(); | |
if (credentials.indexOf(':') > -1) { | |
return credentials.split(':'); | |
} | |
return []; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment