diff options
author | Tom Smeding <tom@tomsmeding.com> | 2025-06-20 20:59:15 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2025-06-20 20:59:15 +0200 |
commit | 19191d45908498b6ea4d9493b4c08caec57b5386 (patch) | |
tree | 4a856f28164cf339f6369ab0598cb480cdd7b22c /webserver.js | |
parent | 745dba98b429b9c06056a444aead4b5983b03600 (diff) |
Diffstat (limited to 'webserver.js')
-rwxr-xr-x | webserver.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/webserver.js b/webserver.js index 40b7e28..ec5575c 100755 --- a/webserver.js +++ b/webserver.js @@ -271,28 +271,28 @@ app.get("/", function (req, res) { // ); }); -app.get(["/f/univq", "/f/univq/*"], cmn.authgen()); +app.get(["/f/univq", "/f/univq/*rest"], cmn.authgen()); -app.get(["/f", "/f/*"], function (req, res) { +app.get(["/f", "/f/*rest"], function (req, res) { requestFile(req, res, unescape(makeUrlSafe(req, 2)), req.url); }); -app.get(["/ff", "/ff/*"], cmn.authgen()); -app.get(["/ff", "/ff/*"], function (req, res) { +app.get(["/ff", "/ff/*rest"], cmn.authgen()); +app.get(["/ff", "/ff/*rest"], function (req, res) { requestFile(req, res, unescape(makeUrlSafe(req, 3)), req.url, {listdirs: true}); }); -app.get("/.well-known/matrix/*", function (req, res) { +app.get("/.well-known/matrix/*rest", function (req, res) { // Prevent these matrix files from being requested for every trifling event // by giving them an explicit cache lifetime requestFile(req, res, "/well-known" + unescape(makeUrlSafe(req, 12)), req.url, {mime: "application/json", cors: true, cache: "public, max-age=7200"}); }); -app.get("/.well-known/*", function (req, res) { +app.get("/.well-known/*rest", function (req, res) { requestFile(req, res, "/well-known" + unescape(makeUrlSafe(req, 12)), req.url); }); -app.get("/google*.html", function (req, res) { +/* app.get("/google*rest.html", function (req, res) { const url = unescape(makeUrlSafe(req, 0)); if (url.match(/^\/google[0-9a-fA-F]*\.html$/)) { const fname = __dirname + url; @@ -303,13 +303,13 @@ app.get("/google*.html", function (req, res) { } else { res.status(404).send("That file does not exist."); } -}); +}); */ ["o", "k", "rip", "rip2"].forEach(function (target) { app.get("/" + target, function (req, res) { res.sendFile(cmn.webfilesdir + "/" + target + ".html"); }); - app.get("/" + target + "/*", function (req, res) { + app.get("/" + target + "/*rest", function (req, res) { res.set('Content-Type', 'text/html'); const msg = url.parse(req.url).pathname.slice(target.length + 2); res.send( |