From cd701c63623c667e8ecbdcae910323fe499d399b Mon Sep 17 00:00:00 2001 From: Jason Mulligan Date: Tue, 3 Sep 2019 20:43:54 -0400 Subject: [PATCH] Moving call to `this.send()` outside of conditional so timing header is present on file streams (og behavior) --- lib/tenso.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tenso.js b/lib/tenso.js index 7ae39402..573a45d9 100644 --- a/lib/tenso.js +++ b/lib/tenso.js @@ -247,14 +247,14 @@ class Tenso extends Base { res.send = (body = "", status = 200, headers = {}) => { let lbody = body; - if (res.headersSent === false && lbody === null || typeof lbody.on !== "function") { + if (lbody === null || typeof lbody.on !== "function") { lbody = serialize(req, lbody, status, headers); lbody = hypermedia(req.server, req, lbody, headers); lbody = this.final(req, res, lbody); lbody = this.render(req, res, lbody, headers); - lbody = this.send(req, res, lbody, status, headers); } + lbody = this.send(req, res, lbody, status, headers); fn(lbody, status, headers); }; }