Skip to content

Commit 570adf3

Browse files
committed
fix(send): Allow express 3.x and 4.x
1 parent a078f50 commit 570adf3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

controller.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,11 @@ var Controller = Class.extend(
365365
this.responseSent = true;
366366
var toCall = type || this.resFunc;
367367
if ( code ) {
368-
this.res.status( code )[ toCall ]( content );
368+
if ( typeof this.res.status === 'function' ) {
369+
this.res.status( code )[ toCall ]( content );
370+
} else {
371+
this.res[ toCall ]( code, content );
372+
}
369373
} else {
370374
this.res[ toCall ]( content );
371375
}

0 commit comments

Comments
 (0)