I am working on my HTTP server and I applied chunked transfer encoding to my responses if the requested file is larger than 64K. It works fine with Firefox, I can even send large videos, but Chrome and Curl simply close the connection and don't display anything.
If I write my response to the file, the result is something like that:
HTTP/1.1 200 OK
Transfer-Encoding: chunked
0x3ff\r\n
a lot of text\r\n
0x41\r\n
less text\r\n
0\r\n
\r\n
Where to search for the problem? Should I add a content-type header? And why it works with Firefox and doesn't work with other browsers/utilities? Thank you in advance.
The issue was that the chunk-lengths were encoded as 0xFF
, while they should have been encoded as FF
.