Skip to content

Commit

Permalink
Moving call to this.send() outside of conditional so timing header …
Browse files Browse the repository at this point in the history
…is present on file streams (og behavior)
  • Loading branch information
avoidwork committed Sep 4, 2019
1 parent 8f495dd commit cd701c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/tenso.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
}
Expand Down

0 comments on commit cd701c6

Please sign in to comment.