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

@fastify/http-proxy

Package Overview
Dependencies
Maintainers
19
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastify/http-proxy - npm Package Compare versions

Comparing version 8.2.2 to 8.2.3

4

index.js

@@ -203,3 +203,3 @@ 'use strict'

function rewriteHeaders (headers) {
function rewriteHeaders (headers, req) {
const location = headers.location

@@ -210,3 +210,3 @@ if (location && !isExternalUrl(location)) {

if (oldRewriteHeaders) {
headers = oldRewriteHeaders(headers)
headers = oldRewriteHeaders(headers, req)
}

@@ -213,0 +213,0 @@ return headers

{
"name": "@fastify/http-proxy",
"version": "8.2.2",
"version": "8.2.3",
"description": "proxy http requests, for Fastify",

@@ -50,3 +50,3 @@ "main": "index.js",

"tap": "^16.0.0",
"tsd": "^0.22.0",
"tsd": "^0.24.1",
"typescript": "^4.5.4",

@@ -53,0 +53,0 @@ "why-is-node-running": "^2.2.2"

@@ -390,3 +390,6 @@ 'use strict'

replyOptions: {
rewriteHeaders: headers => Object.assign({ 'x-test': 'test' }, headers)
rewriteHeaders: (headers, req) => Object.assign({
'x-test': 'test',
'x-req': req.headers['x-req']
}, headers)
}

@@ -401,6 +404,9 @@ })

const { headers } = await got(
`http://localhost:${proxyServer.server.address().port}/api`
)
t.match(headers, { 'x-test': 'test' })
const { headers } = await got({
url: `http://localhost:${proxyServer.server.address().port}/api`,
headers: {
'x-req': 'from-header'
}
})
t.match(headers, { 'x-test': 'test', 'x-req': 'from-header' })
})

@@ -407,0 +413,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