This commit is contained in:
2023-07-03 11:51:13 +08:00
parent b777b4758c
commit 0f3bf48c70
6 changed files with 216 additions and 17 deletions

12
server/cookies.ts Normal file
View File

@@ -0,0 +1,12 @@
export function parse_cookies(c: string | null) {
const m = new Map<string, string>();
if (c === null) return m;
for (const a of c.split(";")) {
const b = a.trim();
const d = b.split("=");
if (d.length > 1) {
m.set(d[0], d.slice(1).join("="));
}
}
return m;
}