mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-12-03 17:43:54 +01:00
fix: handle production source failures and reduce ZIP work
This commit is contained in:
1 parent
bd7d6f0bef
commit
705f7c428a
16 files changed
+612
-86
No files matched your search
@@ -0,0 +1,9 @@
|
||||
import { RequestHandler } from "express";
|
||||
|
||||
/** The asterisk request target asks about the server, not a session or route. */
|
||||
export const serverOptions: RequestHandler = (req, res, next) => {
|
||||
if (req.originalUrl !== "*") return next();
|
||||
if (req.method !== "OPTIONS") { res.status(400).json({ error: "invalid_request" }); return; }
|
||||
res.setHeader("Allow", "GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS");
|
||||
res.status(204).end();
|
||||
};
|
||||
Reference in new issue
Block a user