Browse Source

Remove `return next()` - they are unnecessary in express

Vsevolod Strukchinsky 11 năm trước cách đây
mục cha
commit
bcb585065b
1 tập tin đã thay đổi với 0 bổ sung6 xóa
  1. 0 6
      lib/server.js

+ 0 - 6
lib/server.js

@@ -139,7 +139,6 @@ app._initializeHTTP = function() {
     this.get(this.options.path + ':key/id', function(req, res, next) {
         res.contentType = 'text/html';
         res.send(self._generateClientId(req.params.key));
-        return next();
     });
 
     // Server sets up HTTP streaming when you get post an ID.
@@ -162,7 +161,6 @@ app._initializeHTTP = function() {
         } else {
             self._startStreaming(res, key, id, token);
         }
-        return next();
     });
 
     // Get a list of all peers for a key, enabled by the `allowDiscovery` flag.
@@ -175,11 +173,9 @@ app._initializeHTTP = function() {
                 } else {
                     res.send(401);
                 }
-                return next();
             });
         } else {
             res.send(404);
-            return next();
         }
     });
 
@@ -191,7 +187,6 @@ app._initializeHTTP = function() {
         if (!self._clients[key] || !(client = self._clients[key][id])) {
             if (req.params.retry) {
                 res.send(401);
-                return next();
             } else {
                 // Retry this request
                 req.params.retry = true;
@@ -213,7 +208,6 @@ app._initializeHTTP = function() {
             });
             res.send(200);
         }
-        return next();
     };
 
     this.post(this.options.path + ':key/:id/:token/offer', handle);