Skip to content
Snippets Groups Projects
Commit 1ea16cd3 authored by Éloïs's avatar Éloïs
Browse files

[fix] #1151 ws2p test upnp correction

parent 46c6239a
No related branches found
No related tags found
No related merge requests found
...@@ -239,12 +239,14 @@ export class WS2PAPI extends stream.Transform { ...@@ -239,12 +239,14 @@ export class WS2PAPI extends stream.Transform {
} }
async getEndpoint() { async getEndpoint() {
if (this.upnpAPI && this.server.conf.ws2p) { // If WS2P defined and enabled
if (this.server.conf.ws2p !== undefined && (this.server.conf.ws2p.publicAccess || this.server.conf.ws2p.privateAccess))
{
if (this.server.conf.upnp && this.upnpAPI) {
const config = this.upnpAPI.getCurrentConfig() const config = this.upnpAPI.getCurrentConfig()
return !config ? '' : ['WS2P', this.server.conf.ws2p.uuid, config.remotehost, config.port].join(' ') return !config ? '' : ['WS2P', this.server.conf.ws2p.uuid, config.remotehost, config.port].join(' ')
} }
else if (this.server.conf.ws2p else if (this.server.conf.ws2p.uuid
&& this.server.conf.ws2p.uuid
&& this.server.conf.ws2p.remotehost && this.server.conf.ws2p.remotehost
&& this.server.conf.ws2p.remoteport) { && this.server.conf.ws2p.remoteport) {
let ep = ['WS2P', let ep = ['WS2P',
...@@ -257,8 +259,7 @@ export class WS2PAPI extends stream.Transform { ...@@ -257,8 +259,7 @@ export class WS2PAPI extends stream.Transform {
} }
return ep return ep
} }
else {
return ''
} }
return ''
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment