mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 01:53:27 +02:00
Ensure we add 'http://' to URLs even when a username is used.
This commit is contained in:
@@ -24,10 +24,9 @@ module.exports = function NavigationCtrl($scope, $rootScope) {
|
||||
}
|
||||
|
||||
function addHttp(textUrl) {
|
||||
if (textUrl.indexOf(':') === -1 && textUrl.indexOf('.') !== -1) {
|
||||
return 'http://' + textUrl
|
||||
}
|
||||
return textUrl
|
||||
// Check for '://' because a protocol-less URL might include
|
||||
// a username:password combination.
|
||||
return (textUrl.indexOf('://') === -1 ? 'http://' : '') + textUrl
|
||||
}
|
||||
|
||||
$scope.blurUrl = false
|
||||
|
||||
Reference in New Issue
Block a user