X-Way-Signature header:
Node.js (Express)
Python (Flask)
Pitfalls
- Body re-serialization - the most common failure. Frameworks that eagerly parse JSON (Express’s
express.json(), some serverless runtimes) must be configured to expose the raw body for the webhook route. - Proxies that mutate the body - anything that re-encodes or pretty-prints the JSON between Way and your handler breaks the signature. Verify at the first hop that sees the raw bytes.
- Missing header - deliveries carry
X-Way-Signatureonly when the webhook has a secret configured. If you expect it and it’s absent, treat the request as unauthenticated. - String comparison - use a timing-safe comparison (
crypto.timingSafeEqual,hmac.compare_digest) rather than===.