Noah před 7 roky
rodič
revize
642cbecd3e
1 změnil soubory, kde provedl 4 přidání a 4 odebrání
  1. 4 4
      server/index.js

+ 4 - 4
server/index.js Zobrazit soubor

@@ -66,12 +66,12 @@ app.get("/status/:id/", status);
66 66
 // Serve background images and themes JSON statically
67 67
 app.use("/settings/", function(req, res, next) {
68 68
 
69
-  // Keep server settings off limits
70
-  if (req.url.match(/\.js$/i)) {
71
-    return res.status(404).send("Cannot GET " + path.join("/settings", req.url));
69
+  // Limit to themes.json and bg images
70
+  if (req.url.match(/^\/?themes.json$/i) || req.url.match(/^\/?backgrounds\/[^/]+$/i)) {
71
+    return next();
72 72
   }
73 73
 
74
-  next();
74
+  return res.status(404).send("Cannot GET " + path.join("/settings", req.url));
75 75
 
76 76
 }, express.static(path.join(__dirname, "..", "settings")));
77 77