Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: remove assert to invalid HTTP version #4260

Merged
merged 1 commit into from Sep 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 0 additions & 26 deletions test/unsupported-httpversion.test.js
Expand Up @@ -4,32 +4,6 @@ const net = require('net')
const t = require('tap')
const Fastify = require('../fastify')

t.test('Will return 505 HTTP error if HTTP version (default) is not supported', t => {
const fastify = Fastify()

t.teardown(fastify.close.bind(fastify))

fastify.get('/', (req, reply) => {
reply.send({ hello: 'world' })
})

fastify.listen({ port: 0 }, err => {
t.error(err)

const port = fastify.server.address().port
const client = net.createConnection({ port }, () => {
client.write('GET / HTTP/5.1\r\n\r\n')

client.once('data', data => {
t.match(data.toString(), /505 HTTP Version Not Supported/i)
client.end(() => {
t.end()
})
})
})
})
})

t.test('Will return 505 HTTP error if HTTP version (2.0 when server is 1.1) is not supported', t => {
const fastify = Fastify()

Expand Down