fix register with invalid from and to header (#84)

This commit is contained in:
Hoan Luu Huu
2025-02-18 07:07:37 -05:00
committed by GitHub
parent e687d772d8
commit 6b8b7661da
3 changed files with 59 additions and 1 deletions
+6
View File
@@ -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;