Node.js example suggests JSON.stringify which will modify UTF-8 characters
Opened this issue · 0 comments
mrcljx commented
Environment
Node.js 18
Steps to Reproduce
- Implemented integration following TS example.
function getSignatureBody(req: Request): string { const stringifiedBody = JSON.stringify(req.body); // HACK: This is necessary since express.json() converts the empty request body to {} return stringifiedBody === '{}' ? '' : stringifiedBody; }
- User with special character in their name couldn't use "Create Issue" integration (401)
- Reason was a signature mismatch.
- Raw JSON payload ended in
{/* ... */,"actor":{"type":"user","id":1,"name":"John Do\\u00e9"}}
Expected Result
Signature match.
Actual Result
Signature did not match.
Analysis
Calling JSON.stringify
replaces \u00e9
with é
.