* Create a middleware to parse raw bodies. * * @param {Object} [options] * @returns {Function} * @public
(options)
| 28 | * @public |
| 29 | */ |
| 30 | function raw (options) { |
| 31 | const normalizedOptions = normalizeOptions(options, 'application/octet-stream') |
| 32 | |
| 33 | const readOptions = { |
| 34 | ...normalizedOptions, |
| 35 | // Skip charset validation and parse the body as is |
| 36 | skipCharset: true |
| 37 | } |
| 38 | |
| 39 | return function rawParser (req, res, next) { |
| 40 | read(req, res, next, passthrough, debug, readOptions) |
| 41 | } |
| 42 | } |
nothing calls this directly
no test coverage detected