Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
node_modules
dist
.vscode
.idea
reports
.nyc_output
.DS_Store
Expand Down
6 changes: 3 additions & 3 deletions src/server/service-invoker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class ServiceInvoker {
public async callService(context: ServiceContext) {
try {
await this.callTargetEndPoint(context);
if (this.mustCallNext()) {
if (this.mustCallNext(context)) {
context.next();
} else if (this.debugger.enabled) {
this.debugger('Ignoring next middlewares');
Expand All @@ -38,8 +38,8 @@ export class ServiceInvoker {
}
}

private mustCallNext() {
return !ServerContainer.get().ignoreNextMiddlewares &&
private mustCallNext(context: ServiceContext) {
return !context.response.headersSent && !ServerContainer.get().ignoreNextMiddlewares &&
!this.serviceMethod.ignoreNextMiddlewares && !this.serviceClass.ignoreNextMiddlewares;
}

Expand Down