diff --git a/lib/server/main.js b/lib/server/main.js index 2f1acc60..ff7857a2 100644 --- a/lib/server/main.js +++ b/lib/server/main.js @@ -235,14 +235,15 @@ cache : p.cache, gzip : lGzip, query : getQuery(p.request) - }) ); + })); pipe.create({ - from: p.name, - write: p.response, - zip : lGzip && !p.gziped, - callback: function(pError) { - var lError = pError && pError.toString(); + from: p.name, + write: p.response, + zip : lGzip && !p.gziped, + callback: function(pError) { + var lError = pError && pError.toString(); + if (pError) { p.response.writeHead(FILE_NOT_FOUND, 'OK'); p.response.end(lError);