Skip to content

Commit

Permalink
Merge 8634293 into 8e87e27
Browse files Browse the repository at this point in the history
  • Loading branch information
pixcai committed Jun 15, 2018
2 parents 8e87e27 + 8634293 commit 8858966
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion index.js
Expand Up @@ -94,7 +94,13 @@ proto.use = function use(route, fn) {

// wrap vanilla http.Servers
if (handle instanceof http.Server) {
handle = handle.listeners('request')[0];
var server = handle;
handle = function (req, res, next) {
server.once('request', function () {
next();
});
server.emit('request', req, res);
};
}

// strip trailing slash
Expand Down

0 comments on commit 8858966

Please sign in to comment.