Mercurial > urweb
diff src/c/http.c @ 1119:951fced704d6
Basis.textBlob; support HTTP requests with no headers
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 05 Jan 2010 15:53:35 -0500 |
parents | db52c32dbe42 |
children | 0cee0c8d8c37 |
line wrap: on
line diff
--- a/src/c/http.c Tue Jan 05 14:57:35 2010 -0500 +++ b/src/c/http.c Tue Jan 05 15:53:35 2010 -0500 @@ -147,12 +147,17 @@ } } + body[-4] = '\r'; + body[-3] = '\n'; + if (!(s = strstr(buf, "\r\n"))) { fprintf(stderr, "No newline in request\n"); close(sock); goto done; } + body[-4] = body[-3] = 0; + *s = 0; headers = s + 2; method = s = buf;