Skip to content

Commit a5560af

Browse files
committed
Merge pull request #24 from relvao/master
Fix Express 4 warning
2 parents 21a965c + e61fcbd commit a5560af

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/swagger-express/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,8 @@ exports.init = function (app, opt) {
303303
resource = resources[match[1]];
304304

305305
if (!resource) {
306-
return res.send(404);
306+
//detect if it's express 4.x or 3.5.x
307+
return (res.sendStatus ? res.sendStatus(404) : res.send(404));
307308
}
308309

309310
result.resourcePath = resource.resourcePath;

0 commit comments

Comments
 (0)