mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-17 11:44:38 -05:00
config response header
This commit is contained in:
parent
c6fc385289
commit
62f168a2a5
@ -119,6 +119,13 @@ const { statusPageSocketHandler } = require("./socket-handlers/status-page-socke
|
||||
|
||||
app.use(express.json());
|
||||
|
||||
// Global Middleware
|
||||
app.use(function (req, res, next) {
|
||||
res.setHeader("X-Frame-Options", "SAMEORIGIN");
|
||||
res.removeHeader("X-Powered-By");
|
||||
next();
|
||||
});
|
||||
|
||||
/**
|
||||
* Total WebSocket client connected to server currently, no actual use
|
||||
* @type {number}
|
||||
@ -192,7 +199,7 @@ exports.entryPage = "dashboard";
|
||||
const apiRouter = require("./routers/api-router");
|
||||
app.use(apiRouter);
|
||||
|
||||
// Universal Route Handler, must be at the end of all express route.
|
||||
// Universal Route Handler, must be at the end of all express routes.
|
||||
app.get("*", async (_request, response) => {
|
||||
if (_request.originalUrl.startsWith("/upload/")) {
|
||||
response.status(404).send("File not found.");
|
||||
|
Loading…
Reference in New Issue
Block a user