Files
openclaw/src/line/webhook-utils.ts
Vincent Koc 48cbfdfac0 Hardening: require LINE webhook signatures (#44090)
* LINE: require webhook signatures in express handler

* LINE: require webhook signatures in node handler

* LINE: update express signature tests

* LINE: update node signature tests

* Changelog: note LINE webhook hardening

* LINE: validate signatures before parsing webhook bodies

* LINE: reject missing signatures before body reads
2026-03-12 10:50:36 -04:00

10 lines
238 B
TypeScript

import type { WebhookRequestBody } from "@line/bot-sdk";
export function parseLineWebhookBody(rawBody: string): WebhookRequestBody | null {
try {
return JSON.parse(rawBody) as WebhookRequestBody;
} catch {
return null;
}
}