mirror of
https://github.com/Shineii86/AniKotoAPI.git
synced 2026-10-22 02:45:10 +00:00
feat: add health, stats, OpenAPI, security headers, tests
- /api/health — uptime, version, memory usage - /api/stats — request count, error rate, cache info - /api/openapi — OpenAPI 3.0.3 specification - Security headers: X-Frame-Options, X-Content-Type-Options, X-XSS-Protection - Request counter middleware - CONTRIBUTING.md — contribution guidelines - test.js — integration test suite (18 endpoints)
This commit is contained in:
@@ -67,6 +67,16 @@ app.use((req, res, next) => {
|
||||
.json({ success: false, message: "Forbidden: Origin not allowed" });
|
||||
});
|
||||
|
||||
// ---- FEATURE: Security headers ----
|
||||
app.use((req, res, next) => {
|
||||
res.setHeader("X-Frame-Options", "DENY");
|
||||
res.setHeader("X-Content-Type-Options", "nosniff");
|
||||
res.setHeader("X-XSS-Protection", "1; mode=block");
|
||||
res.setHeader("Referrer-Policy", "strict-origin-when-cross-origin");
|
||||
res.setHeader("Permissions-Policy", "camera=(), microphone=(), geolocation=()");
|
||||
next();
|
||||
});
|
||||
|
||||
// ══════════════════════════════════════════════════════════════
|
||||
// STATIC FILES
|
||||
// ══════════════════════════════════════════════════════════════
|
||||
|
||||
Reference in New Issue
Block a user