New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

light-my-request

Package Overview
Dependencies
Maintainers
8
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

light-my-request - npm Package Compare versions

Comparing version 5.9.0 to 5.9.1

3

lib/request.js

@@ -126,5 +126,2 @@ 'use strict'

}
if (('origin' in this.headers) === false) {
this.headers.origin = 'http://example.com:8080'
}
this.headers.host = this.headers.host || options.authority || hostHeaderFromURL(parsedURL)

@@ -131,0 +128,0 @@

2

package.json
{
"name": "light-my-request",
"version": "5.9.0",
"version": "5.9.1",
"description": "Fake HTTP injection library",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -88,28 +88,2 @@ 'use strict'

test('passes fake origin header', (t) => {
t.plan(2)
const dispatch = function (req, res) {
res.writeHead(200, { 'Content-Type': 'text/plain' })
res.end(req.headers.origin)
}
inject(dispatch, { method: 'GET', url: 'http://example.com:8080/hello' }, (err, res) => {
t.error(err)
t.equal(res.payload, 'http://example.com:8080')
})
})
test('leave intact original origin header', (t) => {
t.plan(2)
const dispatch = function (req, res) {
res.writeHead(200, { 'Content-Type': 'text/plain' })
res.end(req.headers.origin)
}
inject(dispatch, { method: 'GET', url: 'http://example.com:8080/hello', headers: { origin: 'https://lightmyrequest' } }, (err, res) => {
t.error(err)
t.equal(res.payload, 'https://lightmyrequest')
})
})
test('request has rawHeaders', (t) => {

@@ -119,3 +93,3 @@ t.plan(3)

t.ok(Array.isArray(req.rawHeaders))
t.match(req.rawHeaders, ['super', 'duper', 'user-agent', 'lightMyRequest', 'origin', 'http://example.com:8080', 'host', 'example.com:8080'])
t.match(req.rawHeaders, ['super', 'duper', 'user-agent', 'lightMyRequest', 'host', 'example.com:8080'])
res.writeHead(200)

@@ -1646,3 +1620,2 @@ res.end()

host: 'example.com:8080',
origin: 'http://example.com:8080',
'user-agent': 'lightMyRequest'

@@ -1649,0 +1622,0 @@ })

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