You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: prevents fastify-compress from trying to work with something it cannot
Sending something other than buffers of strings in the `payload` happens, but this would break the later `Buffer.byteLength(payload)`
Signed-off-by: Bart Riepe <bart@serial-experiments.com>
// This would previously cause: TypeError [ERR_INVALID_ARG_TYPE]: The "string" argument must be of type string or an instance of Buffer or ArrayBuffer. Received an instance of Response
3372
+
reply.compress(responseObject)
3373
+
})
3374
+
3375
+
constresponse=awaitfastify.inject({
3376
+
url: '/',
3377
+
method: 'GET',
3378
+
headers: {
3379
+
'accept-encoding': 'gzip, deflate, br'
3380
+
}
3381
+
})
3382
+
3383
+
t.assert.equal(response.statusCode,200)
3384
+
// The response should not be compressed since the payload is a Response object
0 commit comments