⚝
One Hat Cyber Team
⚝
Your IP:
172.22.0.1
Server IP:
151.80.20.34
Server:
Linux 794f04d97d5e 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64
Server Software:
Apache/2.4.62 (Debian)
PHP Version:
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
node_modules
/
got
/
dist
/
core
/
utils
/
View File Name :
get-body-size.js
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const fs_1 = require("fs"); const util_1 = require("util"); const is_1 = require("@sindresorhus/is"); const is_form_data_1 = require("./is-form-data"); const statAsync = (0, util_1.promisify)(fs_1.stat); exports.default = async (body, headers) => { if (headers && 'content-length' in headers) { return Number(headers['content-length']); } if (!body) { return 0; } if (is_1.default.string(body)) { return Buffer.byteLength(body); } if (is_1.default.buffer(body)) { return body.length; } if ((0, is_form_data_1.default)(body)) { return (0, util_1.promisify)(body.getLength.bind(body))(); } if (body instanceof fs_1.ReadStream) { const { size } = await statAsync(body.path); if (size === 0) { return undefined; } return size; } return undefined; };