Skip to content

Commit

Permalink
Merge pull request #18 from clout-stack/task/fix-promise-handling
Browse files Browse the repository at this point in the history
fix promise handling
  • Loading branch information
muhammaddadu authored Feb 2, 2020
2 parents ce42431 + df37bfd commit 8db384b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
language: node_js
sudo: false
node_js:
- "12.0.0"
- "10.0.0"
- "8.12.0"
install:
Expand Down
3 changes: 2 additions & 1 deletion hookslib/apiType/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ function handlePromiseAPIDef(fn) {
return function postPromiseHandle(req, resp, next, ...args) {
safePromisifyCallFn(fn, this, [req, resp, null, ...args])
.then((data) => {
if (!resp.headerSent) {
const headerSent = !!resp._header;
if (!headerSent) {
return resp.ok(data);
}
})
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clout-js",
"version": "2.1.0-beta.6",
"version": "2.1.0-beta.7",
"description": "Clean, simplistic, enterprise grade full-stack NodeJS framework",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 8db384b

Please sign in to comment.