Skip to content

Commit

Permalink
Burned this minor version
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Jun 19, 2018
1 parent 7a87e3c commit c67f87e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
18 changes: 7 additions & 11 deletions lib/woodland.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,8 @@ class Woodland extends Base {
};

res.send = (body, status = 200, headers = {}) => {
const byRef = [body, status, headers];

this.onsend(req, res, ...byRef);
http2Send(req, res, ...byRef);
this.onsend(req, res, body, status, headers);
http2Send(req, res, body, status, headers);
};

res.writeHead = (status = res.statusCode, headers) => {
Expand All @@ -106,16 +104,14 @@ class Woodland extends Base {
};
} else {
res.send = (body, status = 200, headers = {}) => {
const byRef = [body, status, headers];

this.onsend(req, res, ...byRef);
this.onsend(req, res, body, status, headers);

if (res.statusCode < byRef[1]) {
res.statusCode = byRef[1];
if (res.statusCode < status) {
res.statusCode = status;
}

res.writeHead(res.statusCode, byRef[2]);
res.end(byRef[0]);
res.writeHead(res.statusCode, headers);
res.end(body);
};
}

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "woodland",
"version": "6.1.1",
"version": "6.1.2",
"description": "Lightweight HTTP/HTTPS/HTTP2 router with automatic `Allow` & `CORS` headers",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit c67f87e

Please sign in to comment.