total5 0.0.14-3 → 0.0.14-4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/routing.js +5 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "total5",
3
- "version": "0.0.14-3",
3
+ "version": "0.0.14-4",
4
4
  "description": "Total.js framework v5",
5
5
  "main": "index.js",
6
6
  "directories": {
package/routing.js CHANGED
@@ -324,7 +324,7 @@ Route.prototype.remove = function() {
324
324
  F.routes.websockets.splice(index);
325
325
  for (let conn of self.connections)
326
326
  conn.destroy();
327
- break;
327
+ break;
328
328
  case 'file':
329
329
  index = F.routes.files.indexOf(self);
330
330
  if (index !== -1)
@@ -700,10 +700,13 @@ exports.lookupfile = function(ctrl, auth = 0) {
700
700
  if (route)
701
701
  return route;
702
702
 
703
- let key = '/';
703
+ let key = '';
704
704
  for (let i = 0; i < ctrl.split2.length - 1; i++)
705
705
  key += (i ? '/' : '') + ctrl.split2[i];
706
706
 
707
+ if (!key)
708
+ key = '/';
709
+
707
710
  let routes = F.routes.filescache[key];
708
711
  if (routes)
709
712
  return compareflags(ctrl, routes, auth);