@fastify/websocket
Advanced tools
Comparing version 6.0.0 to 6.0.1
@@ -96,3 +96,3 @@ 'use strict' | ||
fastify.addHook('onResponse', (request, reply, error, done) => { | ||
fastify.addHook('onResponse', (request, reply, done) => { | ||
if (request.ws) { | ||
@@ -216,3 +216,3 @@ request.raw[kWs].destroy() | ||
fastify: '>= 3.11.0', | ||
name: 'fastify-websocket' | ||
name: '@fastify/websocket' | ||
}) |
{ | ||
"name": "@fastify/websocket", | ||
"version": "6.0.0", | ||
"version": "6.0.1", | ||
"description": "basic websocket support for fastify", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -8,2 +8,3 @@ 'use strict' | ||
const WebSocket = require('ws') | ||
const split = require('split2') | ||
@@ -339,4 +340,5 @@ test('Should run onRequest, preValidation, preHandler hooks', t => { | ||
test('Should not hijack reply for an WS request to a WS route that gets sent a normal HTTP response in a hook', t => { | ||
t.plan(2) | ||
const fastify = Fastify() | ||
t.plan(6) | ||
const stream = split(JSON.parse) | ||
const fastify = Fastify({ logger: { stream } }) | ||
@@ -353,2 +355,6 @@ fastify.register(fastifyWebsocket) | ||
stream.on('data', (chunk) => { | ||
t.ok(chunk.level < 50) | ||
}) | ||
fastify.listen({ port: 0 }, err => { | ||
@@ -355,0 +361,0 @@ t.error(err) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1709
5
74593