Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /usr/local/lib/node_modules/homebridge-camera-ui/node_modules/telegraf/lib/core/network/ drwxr-xr-x | |
| Viewing file: Select action/file-type: "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const debug_1 = require("debug");
const safeCompare = require("safe-compare");
const debug = (0, debug_1.default)('telegraf:webhook');
function default_1(hookPath, updateHandler) {
return async (req, res, next = () => {
res.statusCode = 403;
debug('Replying with status code', res.statusCode);
return res.end();
}) => {
debug('Incoming request', req.method, req.url);
if (req.method !== 'POST' || !safeCompare(hookPath, req.url)) {
return next();
}
let update;
if (req.body != null) {
update = req.body;
await updateHandler(update, res);
return;
}
let body = '';
for await (const chunk of req) {
body += String(chunk);
}
try {
update = JSON.parse(body);
}
catch (error) {
res.writeHead(415);
res.end();
debug('Failed to parse request body:', error);
return;
}
await updateHandler(update, res);
};
}
exports.default = default_1;
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.032 ]-- |