Files
Chris Tate c8b42772a8 fix(http): enforce HTTP/1.1 Host requirement (#388)
* fix(http): enforce HTTP/1.1 Host requirement

- Enforce Node's default Host behavior while preserving opt-out and HTTP/1.0 handling.

- Match the 400 wire response and add C/LLVM differential coverage.

* feat(http): add static HTTP trailer and streaming support

- Parse incoming chunk trailers and expose distinct/raw trailer reads.
- Frame outgoing trailers and add streaming controls with differential coverage.

* fix(http): harden request trailer parsing

- Safely discard trailers after early responses while preserving parser validation.
- Bound aggregate head and trailer parsing by bytes and field count.
- Add regressions for early response trailers and overflow rejection.
2026-09-23 10:21:53 -05:00

12 lines
309 B
TypeScript

import { createServer } from "node:http";
const server = createServer((req, res) => {
console.log("handler " + req.url);
res.end("ok");
if (req.url === "/quit") server.close(() => console.log("closed"));
});
server.listen(0, () => {
process.stderr.write("PORT " + server.address().port + "\n");
});