Aktueller Stand

This commit is contained in:
2026-01-22 19:05:45 +01:00
parent 85dee61a4d
commit e280e4eadb
1967 changed files with 397327 additions and 74093 deletions

View File

@@ -1,31 +1,30 @@
'use strict'
const t = require('tap')
const test = t.test
const { test } = require('node:test')
const Fastify = require('../..')
const h2url = require('h2url')
const msg = { hello: 'world' }
const fastify = Fastify({
http2: true
})
test('http2 unknown http method', async t => {
const fastify = Fastify({
http2: true
})
fastify.get('/', function (req, reply) {
reply.code(200).send(msg)
})
fastify.get('/', function (req, reply) {
reply.code(200).send(msg)
})
fastify.listen({ port: 0 }, err => {
t.error(err)
t.teardown(() => { fastify.close() })
t.after(() => { fastify.close() })
await fastify.listen({ port: 0 })
test('http UNKNOWN_METHOD request', async (t) => {
await t.test('http UNKNOWN_METHOD request', async (t) => {
t.plan(2)
const url = `http://localhost:${fastify.server.address().port}`
const res = await h2url.concat({ url, method: 'UNKNOWN_METHOD' })
t.equal(res.headers[':status'], 404)
t.same(JSON.parse(res.body), {
t.assert.strictEqual(res.headers[':status'], 404)
t.assert.deepStrictEqual(JSON.parse(res.body), {
statusCode: 404,
code: 'FST_ERR_NOT_FOUND',
error: 'Not Found',