mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-19 05:29:46 +08:00
* 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.
12 lines
309 B
TypeScript
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");
|
|
});
|