diff --git a/lib/net/upnp.js b/lib/net/upnp.js index f187b42c..f435385d 100644 --- a/lib/net/upnp.js +++ b/lib/net/upnp.js @@ -697,12 +697,12 @@ function findError(el) { */ function parseHost(uri) { - let data = url.parse(uri); + let {protocol, host} = url.parse(uri); - assert(data.protocol === 'http:' || data.protocol === 'https:', + assert(protocol === 'http:' || protocol === 'https:', 'Bad URL for location.'); - return `${data.protocol}//${data.host}`; + return `${protocol}//${host}`; } function prependHost(host, uri) {