@aikidosec/firewall
Version:
Zen by Aikido is an embedded Application Firewall that autonomously protects Node.js apps against common and critical attacks, provides rate limiting, detects malicious traffic (including bots), and more.
15 lines (14 loc) • 418 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.replaceRequestBody = replaceRequestBody;
// Copies all properties from the stream to the base object
function replaceRequestBody(base, stream) {
for (const key in stream) {
let v = stream[key];
if (typeof v === "function") {
v = v.bind(base);
}
base[key] = v;
}
return base;
}