From 62a2670b8146567b22e9dc2fa23c35ed0d1a71d5 Mon Sep 17 00:00:00 2001 From: "Haynes, Royce L" Date: Thu, 6 Mar 2014 09:01:11 -0700 Subject: [PATCH] Set header of response if callback isn't being used. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 80721af..e59d1fe 100644 --- a/index.js +++ b/index.js @@ -222,12 +222,12 @@ var Framer = module.exports = function Framer(opts) { cb = cb === undefined ? null : cb; uri = require('url').parse(req.url, true).pathname; - res.setHeader('Content-Type', s3res.headers['content-type']); self._s3Client.deleteFile(uri, function(err, res){ if(cb){ cb(err, res); } else { + res.setHeader('Content-Type', s3res.headers['content-type']); res.end(JSON.stringify({statusCode: 200, message: 'File deleted.'})); } });