File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ import { broadcastToUsers } from '@/ws/handler';
2424
2525/** Extended request with raw body for signature verification. */
2626interface RawBodyRequest extends FastifyRequest {
27- rawBody ?: Buffer ;
27+ rawBody ?: string | Buffer ;
2828}
2929
3030/** Zod schema for GitHub Issues webhook payload. */
@@ -136,7 +136,10 @@ export function webhookRoutes(app: FastifyInstance): void {
136136 error : 'Raw body required for signature verification. Server misconfiguration.' ,
137137 } ) ;
138138 }
139- const rawBody = rawRequest . rawBody ;
139+ const rawBody =
140+ typeof rawRequest . rawBody === 'string'
141+ ? Buffer . from ( rawRequest . rawBody )
142+ : rawRequest . rawBody ;
140143
141144 const signature = getHeader ( request , 'x-hub-signature-256' ) ;
142145 const event = getHeader ( request , 'x-github-event' ) ;
You can’t perform that action at this time.
0 commit comments