Skip to content

Commit

Permalink
middleware chain is broken when found ctx.output
Browse files Browse the repository at this point in the history
I'm not sure about this - I need your eyes here.
If I'm on target - I'll add tests so you can merge.

I'm using restify, and I have other mw on the chain after the swagger_router.
(e.g `server.on('after', restify.auditLogger(options.auditLogCfg));` )

I first noted that when I dont use json_error_handler - I get the audit entry on requests that error, and when I do - I dont.
(e.g. - the 'after' event is not emitted)

The research led me to the corrected lines.
  • Loading branch information
osher authored Nov 9, 2016
1 parent 13498c9 commit ac6dad9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/connect_middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ function Middleware(runner) {

debugContent('sending response body: %s', body);
response.end(body);
} else {
next();
}
}

next();
}
catch (err) {
/* istanbul ignore next */
Expand Down

0 comments on commit ac6dad9

Please sign in to comment.