Skip to content

basalt / drives/src / notificationBytes

Function: notificationBytes() ​

> notificationBytes(body, request, resolver, maxBytes): Buffer

Defined in: drives/src/routes.ts:502

The bytes of a notification, or a refusal.

Normally this is just body.bytes — rawBody() already delivered the octets the pipeline read, on whichever adapter is serving. The explicit resolver wins when an app supplies one, for the deployments that terminate the request somewhere the neutral layer cannot see.

What remains deliberately absent is any path back to request.body: reconstructing the message by re-serialising a parsed object produces different bytes, so it can only make a correct signature look wrong or — in a route that shrugged that off — make every signature look right.

Parameters ​

body ​

unknown

request ​

HttpRequest

resolver ​

((request) => string | Buffer<ArrayBufferLike> | undefined) | undefined

maxBytes ​

number

Returns ​

Buffer

Released under the MIT License.