support expect-100 mechanism for curl -T

Massimo Melina committed Jan 24, 2023 at 16:31 UTC f6a6753fedd2d5aa5eb3216d0e14cc1dbafa88fc
1 file changed +2
src/listen.ts
+2
@@ -115,6 +115,8 @@ function startServer(srv: typeof httpSrv, { port, host }: StartServer) {
115 try {
116 if (port < 0 || !host && !await testIpV4()) // !host means ipV4+6, and if v4 port alone is busy we won't be notified of the failure, so we'll first test it on its own
117 return resolve(0)
118 + // from a few tests, this seems enough to support the expect-100 http/1.1 mechanism, at least with curl -T, not used by chrome|firefox anyway
119 + srv.on('checkContinue', (req, res) => srv.emit('request', req, res))
120 port = await listen(host)
121 if (port)
122 console.log(srv.name, "serving on", host||"any network", ':', port)