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,35 +1,34 @@
'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' }
let fastify
try {
fastify = Fastify({
http2: true
test('http2 HEAD test', async (t) => {
let fastify
try {
fastify = Fastify({
http2: true
})
t.assert.ok(true, 'http2 successfully loaded')
} catch (e) {
t.assert.fail('http2 loading failed')
}
fastify.all('/', function (req, reply) {
reply.code(200).send(msg)
})
t.pass('http2 successfully loaded')
} catch (e) {
t.fail('http2 loading failed', e)
}
t.after(() => { fastify.close() })
fastify.all('/', function (req, reply) {
reply.code(200).send(msg)
})
await fastify.listen({ port: 0 })
fastify.listen({ port: 0 }, err => {
t.error(err)
t.teardown(() => { fastify.close() })
test('http HEAD request', async (t) => {
await t.test('http HEAD request', async (t) => {
t.plan(1)
const url = `http://localhost:${fastify.server.address().port}`
const res = await h2url.concat({ url, method: 'HEAD' })
t.equal(res.headers[':status'], 200)
t.assert.strictEqual(res.headers[':status'], 200)
})
})