Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const server = http.createServer((req, res) => {
if (req.method === 'POST') {
// messages TO the target
Asm.connectTo(
pump(req, jsonParser())
).on('done', ({current: object}) => {
this.trackRequest({ ws: false, data: object});
});
}
if (!ws) {
proxy.web(req, res);
}
});
const server = http.createServer((req, res) => {
if (req.method === 'POST') {
// messages TO the target
Asm.connectTo(
pump(req, jsonParser())
).on('done', ({current: object}) => {
this.trackRequest({ ws: false, data: object});
});
}
if (!ws) {
proxy.web(req, res);
}
});
const server = http.createServer((req, res) => {
if (req.method === 'POST') {
// messages TO the target
Asm.connectTo(
pump(req, jsonParser())
).on('done', ({current: object}) => {
this.trackRequest(object);
});
}
if (!ws) {
proxy.web(req, res);
}
});