per RFC 3261 the request-uri of REGISTER must not have userinfo (#72)

This commit is contained in:
Dave Horton
2024-08-21 09:32:24 -04:00
committed by GitHub
parent 2362605beb
commit 496d6c7a71

View File

@@ -124,13 +124,16 @@ class Regbot {
}
this.logger.debug(`sending REGISTER for ${this.aor}`);
const isIPv4 = /[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/.test(this.ipv4);
const isIPv4 = /^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/.test(this.ipv4);
const proxy = `sip:${this.ipv4}${isIPv4 ? `:${this.port}` : ''};transport=${transport}`;
const req = await srf.request(`${scheme}:${this.aor}`, {
this.logger.debug({isIPv4}, `sending via proxy ${proxy}`);
const req = await srf.request(`${scheme}:${this.sip_realm}`, {
method: 'REGISTER',
proxy,
headers: {
'From': this.from,
'To': this.from,
'Contact': `<${scheme}:${contactAddress};transport=${transport}>;expires=${DEFAULT_EXPIRES}`,
'Expires': DEFAULT_EXPIRES
},