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

@fastify/middie

Package Overview
Dependencies
Maintainers
19
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastify/middie - npm Package Compare versions

Comparing version 8.1.0 to 8.2.0

1

index.js

@@ -36,2 +36,3 @@ 'use strict'

req.raw.hostname = req.hostname
req.raw.protocol = req.protocol
req.raw.ip = req.ip

@@ -38,0 +39,0 @@ req.raw.ips = req.ips

4

package.json
{
"name": "@fastify/middie",
"version": "8.1.0",
"version": "8.2.0",
"description": "Middleware engine for Fastify",

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

"tap": "^16.0.0",
"tsd": "^0.25.0"
"tsd": "^0.28.0"
},

@@ -51,0 +51,0 @@ "dependencies": {

@@ -10,9 +10,10 @@ 'use strict'

test('Should enhance the Node.js core request/response objects', t => {
t.plan(13)
test('Should enhance the Node.js core request/response objects', (t) => {
t.plan(14)
const fastify = Fastify()
t.teardown(fastify.close)
fastify.register(middiePlugin, { hook: 'preHandler' })
.after(() => { fastify.use(cors()) })
fastify.register(middiePlugin, { hook: 'preHandler' }).after(() => {
fastify.use(cors())
})

@@ -23,2 +24,3 @@ fastify.post('/', async (req, reply) => {

t.equal(req.raw.hostname, req.hostname)
t.equal(req.raw.protocol, req.protocol)
t.equal(req.raw.ip, req.ip)

@@ -37,14 +39,17 @@ t.same(req.raw.ips, req.ips)

t.error(err)
sget({
method: 'POST',
url: `${address}?foo=bar`,
body: { bar: 'foo' },
json: true
}, (err, res, data) => {
t.error(err)
})
sget(
{
method: 'POST',
url: `${address}?foo=bar`,
body: { bar: 'foo' },
json: true
},
(err, res, data) => {
t.error(err)
}
)
})
})
test('Should not enhance the Node.js core request/response objects when there are no middlewares', t => {
test('Should not enhance the Node.js core request/response objects when there are no middlewares', (t) => {
t.plan(11)

@@ -71,11 +76,14 @@ const fastify = Fastify()

t.error(err)
sget({
method: 'POST',
url: `${address}?foo=bar`,
body: { bar: 'foo' },
json: true
}, (err, res, data) => {
t.error(err)
})
sget(
{
method: 'POST',
url: `${address}?foo=bar`,
body: { bar: 'foo' },
json: true
},
(err, res, data) => {
t.error(err)
}
)
})
})

Sorry, the diff of this file is not supported yet

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