cloudhead / node-static

rfc 2616 compliant HTTP static-file server module, with built-in caching.
MIT License
2.17k stars 245 forks source link

with listener, server doesn't send 404 #206

Open akostadinov opened 6 years ago

akostadinov commented 6 years ago
        file.serve(request, response).addListener('error', function (err) {
          console.error("Error serving " + request.url + " - " + err.message);
        });

If I add a listener, then request times out instead of returning 404 as project README suggests. If I remove listener and only have file.serve(request, response);, then 404 is properly returned.