Closed Gennaro001 closed 5 years ago
Thanks for reporting. I think I fixed the bug now. The problem was that the headers didn't reset after the response was sent. Although your suggested fix would have worked, my original idea was to give the user complete freedom over if he wants to set the Content-Length by himself or not. Besides that, the bug goes beyond just the Content-Length header. For example if you were to set any other response header e.g. Access-Control-Allow-Origin
in one route, it would from there on be sent with the response of every route.
So the fix I decided to go with was to simply reset the _headers property to the defaultHeaders.
I haven't tested the fix because I don't have an ESP8266 on my hands right now.
on line 173 there are this statement:
if body and this._headers['Content-Length'] == nil then
if i write this 2 lineapp:use('/index.html')
app:use('/style.css')
the_headers['Content-Length']
value remain the length of first file it is send with bad content-length value with undefined result i replaced line 173 with:if body then
and now work correctly