test: fixed improper signed_string reconstruction in .verify()

This commit is contained in:
Julian Lam
2023-08-08 15:33:35 -04:00
parent bcee1c8dc8
commit cc0d18869a
2 changed files with 3 additions and 1 deletions

View File

@@ -136,7 +136,7 @@ ActivityPub.verify = async (req) => {
// Re-construct signature string
const signed_string = headers.split(' ').reduce((memo, cur) => {
if (cur === '(request-target)') {
memo.push(`${cur}: ${String(req.method).toLowerCase()} ${req.path}`);
memo.push(`${cur}: ${String(req.method).toLowerCase()} ${req.baseUrl}${req.path}`);
} else if (req.headers.hasOwnProperty(cur)) {
memo.push(`${cur}: ${req.headers[cur]}`);
}