|
@@ -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
|
|