Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hijackresponse

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hijackresponse - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

lib/hijackResponse.js

@@ -96,4 +96,6 @@ var Readable = require('stream').Readable

hijacking = false
res.write = write
res.end = end
return originalResponse
}
}

2

package.json
{
"name": "hijackresponse",
"version": "0.0.1",
"version": "0.0.2",
"description": "Hijack HttpResponses",

@@ -5,0 +5,0 @@ "main": "lib/hijackResponse.js",

@@ -42,10 +42,13 @@ /* global describe, it */

hijackResponse(res, passError(handleError, function (res) {
var chunks = []
res.on('data', function (chunk) {
res.write(chunk)
chunks.push(chunk)
}).on('end', function () {
res.write('qux')
res.end()
res.setHeader('X-qux', 'hijacked')
res.write(Buffer.concat(chunks))
res.end('qux')
})
}))
res.setHeader('X-bar', 'hijacked');
res.on('data', function (chunk) {

@@ -62,3 +65,9 @@ res.write(chunk)

res.end()
}, 'to yield response', 'foobarqux')
}, 'to yield response', {
headers: {
'X-qux': 'hijacked',
'X-bar': 'hijacked'
},
body: 'foobarqux'
})
})

@@ -65,0 +74,0 @@ it('should be able to hijack an already hijacked response when piping', function () {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc