release: WRNexusJS 0.7.0

This commit is contained in:
2026-08-01 10:04:42 +05:30
parent c54144f2e4
commit 87507edf59
207 changed files with 12607 additions and 679 deletions
+7 -7
View File
@@ -486,13 +486,13 @@ export async function startServer(opts: ServeOptions): Promise<RunningServer> {
const url = new URL(request.url);
const origin = request.headers.get("origin");
if (origin && origin !== url.origin) return false;
const cookieToken = /(?:^|;\s*)wrnexus_csrf=([^;]+)/.exec(
request.headers.get("cookie") ?? "",
)?.[1];
return (
!cookieToken ||
decodeURIComponent(cookieToken) === (request.headers.get("x-wrnexus-csrf") ?? "")
);
const cookieHeader = request.headers.get("cookie") ?? "";
const cookieToken =
/(?:^|;\s*)wire-csrf=([^;]+)/.exec(cookieHeader)?.[1] ??
/(?:^|;\s*)wrnexus_csrf=([^;]+)/.exec(cookieHeader)?.[1];
const headerToken =
request.headers.get("x-csrf-token") ?? request.headers.get("x-wrnexus-csrf") ?? "";
return !cookieToken || decodeURIComponent(cookieToken) === headerToken;
},
});