aboutsummaryrefslogtreecommitdiff
path: root/node_modules/hosted-git-info/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/hosted-git-info/index.js')
-rw-r--r--node_modules/hosted-git-info/index.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/node_modules/hosted-git-info/index.js b/node_modules/hosted-git-info/index.js
index 9055ab185..c1c2cc899 100644
--- a/node_modules/hosted-git-info/index.js
+++ b/node_modules/hosted-git-info/index.js
@@ -26,6 +26,7 @@ var authProtocols = {
var cache = {}
module.exports.fromUrl = function (giturl, opts) {
+ if (typeof giturl !== 'string') return
var key = giturl + JSON.stringify(opts || {})
if (!(key in cache)) {
@@ -58,7 +59,7 @@ function fromUrl (giturl, opts) {
project = decodeURIComponent(shortcutMatch[3])
defaultRepresentation = 'shortcut'
} else {
- if (parsed.host !== gitHostInfo.domain) return
+ if (parsed.host && parsed.host !== gitHostInfo.domain && parsed.host.replace(/^www[.]/, '') !== gitHostInfo.domain) return
if (!gitHostInfo.protocols_re.test(parsed.protocol)) return
if (!parsed.path) return
var pathmatch = gitHostInfo.pathmatch