Skip to content

Commit ac6dad9

Browse files
authored
middleware chain is broken when found ctx.output
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.
1 parent 13498c9 commit ac6dad9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/connect_middleware.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ function Middleware(runner) {
8989

9090
debugContent('sending response body: %s', body);
9191
response.end(body);
92-
} else {
93-
next();
94-
}
92+
}
93+
94+
next();
9595
}
9696
catch (err) {
9797
/* istanbul ignore next */

0 commit comments

Comments
 (0)