You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
522 B

4 years ago
'use strict'
const t = require('tap')
const test = t.test
const Fastify = require('../fastify')
test('#2214 - wrong content-length', t => {
const fastify = Fastify()
fastify.get('/', async () => {
const error = new Error('MY_ERROR_MESSAGE')
error.headers = {
'content-length': 2
}
throw error
})
fastify.inject({
method: 'GET',
path: '/'
})
.then(response => {
t.strictEqual(response.headers['content-length'], '' + response.rawPayload.length)
t.end()
})
})