Kitten

Technical Manual sections

Kitten parses request bodies with @small-web/kitten-busboy, its own fork of express-busboy. Each HTTP route parses its own body, after Polka has chosen it, with a parser that createBodyParser() in src/lib/body.ts creates from kitten-busboy’s parser(). It parses URL-encoded, JSON, and multipart bodies into request.body, adds request.rawBody for a body that isn’t multipart (e.g., to validate a webhook’s signature), and writes uploaded files to the app’s uploads/ folder. The parser marks the request (parsingStarted), so a request is parsed at most once, and a request that no route responds to is never parsed.

Source code:

Like this? Fund us!

Small Technology Foundation is a tiny, independent not-for-profit.

We exist in part thanks to patronage by people like you. If you share our vision and want to support our work, please become a patron or donate to us today and help us continue to exist.