csquared / arduino-restclient

Arduino RESTful HTTP Request Library
MIT License
205 stars 133 forks source link

The content length was computed incorrectly #22

Open cat101 opened 6 years ago

cat101 commented 6 years ago

I found that in certain conditions, the server would respond before the last CRLF was sent and then when the arduino tried put write it would receive a connection reset

fnevgeny commented 11 months ago

FWIW, it's off by 4 bytes, not 1 - two CRLF's are sent after the body. And both are extraneous IMO, see https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html : "[...] an HTTP/1.1 client MUST NOT preface or follow a request with an extra CRLF".