is-reachable
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -5,2 +5,3 @@ /* eslint-env browser */ | ||
const pAny = require('p-any'); | ||
const urlParseLax = require('url-parse-lax'); | ||
@@ -12,8 +13,14 @@ module.exports = hosts => { | ||
x = urlParseLax(x); | ||
const protocol = x.protocol || ''; | ||
const host = x.hostname; | ||
const port = x.port ? `:${x.port}` : ''; | ||
img.onload = () => resolve(true); | ||
img.onerror = () => resolve(false); | ||
img.src = `//${x}/favicon.ico?${Date.now()}`; | ||
img.src = `${protocol}//${host}${port}/favicon.ico?${Date.now()}`; | ||
}); | ||
})); | ||
}; |
{ | ||
"name": "is-reachable", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Check if servers are reachable", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
4918
58