RFC 2616 for HTTP/1.1 dictates that a 304 Page-Not-Modified should have no body.
... The 304 response MUST NOT contain a message-body, and thus is always terminated by the first empty line after the header fields....
lightnode currently uses the chunked encoding header for all responses, including 304s. This results in a "0\r\n" following the message headers.
The following change to move the chunked header to the else clause resolves the issue for me.
//REMOVED headers['transfer-encoding'] = 'chunked'headers['server']='lightnode'if(Date.parse(file.header.mtime)<=Date.parse(req.headers['if-modified-since'])){resp.writeHead(304,headers)resp.end()return}else{headers['transfer-encoding']='chunked'// ADDED
RFC 2616 for HTTP/1.1 dictates that a 304 Page-Not-Modified should have no body.
... The 304 response MUST NOT contain a message-body, and thus is always terminated by the first empty line after the header fields....
lightnode currently uses the chunked encoding header for all responses, including 304s. This results in a "0\r\n" following the message headers.
The following change to move the chunked header to the else clause resolves the issue for me.