From 606fa8ffab5b852be149e6ab6673f40ec45ccb07 Mon Sep 17 00:00:00 2001 From: Mathew Kurian Date: Tue, 20 May 2014 14:47:19 -0500 Subject: [PATCH] Update index.js --- src/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index fb89777..46c3095 100644 --- a/src/index.js +++ b/src/index.js @@ -236,8 +236,10 @@ var getlog = function(req, res) { if(fs.existsSync(filepath)){ var stream = fs.createReadStream(filepath); - res.header('Content-type', 'text/plain'); - res.header('Content-length', fs.statSync(filepath)["size"]); + res.writeHead(200, { + 'Content-Length': fs.statSync(filepath)["size"], + 'Content-Type': 'text/plain', + }); stream.pipe(res); } else{ res.statusCode = 404;