No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

request.js 503B

12345678910111213141516171819
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.reqBodyToBuffer = void 0;
  4. async function reqBodyToBuffer(req) {
  5. if (req.body instanceof Buffer) {
  6. return Buffer.from(req.body);
  7. }
  8. const bufs = [];
  9. req.on("data", (data) => {
  10. bufs.push(data);
  11. });
  12. await new Promise((resolve) => {
  13. req.on("end", () => {
  14. resolve();
  15. });
  16. });
  17. return Buffer.concat(bufs);
  18. }
  19. exports.reqBodyToBuffer = reqBodyToBuffer;