Hi all,
I'm writing a server that can receive streaming audio (using the Icecast protocol) over HTTP. The gist of the protocol is:
- Client sends a PUT with, among others, a "Expect: 100-continue"
- Server validates the request and replies with "HTTP/1.1 100 Continue"
- Client streams data
The issue I'm running into is that net/http server replies with a 200 OK instead of a 100 Continue unless either the Content-Length is nonzero or Transfer-Encoding is Chunked - the former makes no sense for a (theoretically) infinite stream, while none of the clients I've tested (broadcast-using-this-tool and ffmpeg) do the latter.
I noted that net/http/server.go checks req.ContentLength != 0 before setting canWriteContinue - would it be worthwhile either removing this check, or setting req.ContentLength to -1 if Expect: 100-continue is set for a POST or PUT? This would better mirror real-world behaviour.
thanks,
Marks