mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-29 07:01:40 +03:00
fix(browser): annotate csrf middleware type
This commit is contained in:
+5
-1
@@ -54,7 +54,11 @@ export function shouldRejectBrowserMutation(params: {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function browserMutationGuardMiddleware() {
|
export function browserMutationGuardMiddleware(): (
|
||||||
|
req: Request,
|
||||||
|
res: Response,
|
||||||
|
next: NextFunction,
|
||||||
|
) => void {
|
||||||
return (req: Request, res: Response, next: NextFunction) => {
|
return (req: Request, res: Response, next: NextFunction) => {
|
||||||
// OPTIONS is used for CORS preflight. Even if cross-origin, the preflight isn't mutating.
|
// OPTIONS is used for CORS preflight. Even if cross-origin, the preflight isn't mutating.
|
||||||
const method = (req.method || "").trim().toUpperCase();
|
const method = (req.method || "").trim().toUpperCase();
|
||||||
|
|||||||
Reference in New Issue
Block a user