Spaces:
Sleeping
Sleeping
File size: 523 Bytes
cfbbc1a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getBodyParserOptions = getBodyParserOptions;
const rawBodyParser = (req, _res, buffer) => {
if (Buffer.isBuffer(buffer)) {
req.rawBody = buffer;
}
return true;
};
function getBodyParserOptions(rawBody, options) {
let parserOptions = (options || {});
if (rawBody === true) {
parserOptions = {
...parserOptions,
verify: rawBodyParser,
};
}
return parserOptions;
}
|