mirror of
https://github.com/jambonz/sbc-sip-sidecar.git
synced 2026-10-04 02:04:20 +00:00
fix register with invalid from and to header (#84)
This commit is contained in:
@@ -24,6 +24,12 @@ const checkCache = async(req, res, next) => {
|
||||
const {logger} = req.locals;
|
||||
const registration = req.registration;
|
||||
const uri = parseUri(registration.aor);
|
||||
// if cannot parse uri, then we cannot proceed
|
||||
if (!uri) {
|
||||
return res.send(403, {headers: {
|
||||
'X-Reason': 'Invalid address of record'
|
||||
}});
|
||||
}
|
||||
const aor = `${uri.user}@${uri.host}`;
|
||||
req.locals.realm = uri.host;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user