mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 08:13:31 +02:00
Ensure we add 'http://' to URLs even when a username is used.
This commit is contained in:
@@ -67,9 +67,17 @@ module.exports = syrup.serial()
|
||||
.then(updateBrowsers)
|
||||
}
|
||||
|
||||
function ensureHttpProtocol(url) {
|
||||
// Check for '://' because a protocol-less URL might include
|
||||
// a username:password combination.
|
||||
return (url.indexOf('://') === -1 ? 'http://' : '') + url
|
||||
}
|
||||
|
||||
service.on('browserPackageChange', updateBrowsers)
|
||||
|
||||
router.on(wire.BrowserOpenMessage, function(channel, message) {
|
||||
message.url = ensureHttpProtocol(message.url)
|
||||
|
||||
if (message.browser) {
|
||||
log.info('Opening "%s" in "%s"', message.url, message.browser)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user