Yes, sounds to me like Espruino should count bytes and close the connection when that's reached (maybe only if there's a content length header?).
However, I'd say that people have been using HTTP with Espruino for a long time, and it seems that they don't generally have problems with this. Espruino's HTTP client does seem to work fine in pretty much all cases, or there would be a lot more complaints on the forum.
As far as I can tell:
Espruino does send HTTP/1.0 in the header
It also always adds a Connection: close header
From the spec @tve noted above, it looks like in this case the HTTP server should definitely close the request, and AutoRemote itself is not doing what it should?
So yes, we should add content length counting, but I don't think it's actually that high priority?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Yes, sounds to me like Espruino should count bytes and close the connection when that's reached (maybe only if there's a content length header?).
However, I'd say that people have been using HTTP with Espruino for a long time, and it seems that they don't generally have problems with this. Espruino's HTTP client does seem to work fine in pretty much all cases, or there would be a lot more complaints on the forum.
As far as I can tell:
Connection: close
headerFrom the spec @tve noted above, it looks like in this case the HTTP server should definitely close the request, and AutoRemote itself is not doing what it should?
So yes, we should add content length counting, but I don't think it's actually that high priority?