Spaces:
Paused
Paused
Download src/utils/parse-cookie.ts from lenson78/codex-proxy: direct link, hf CLI and curl.
- Browser
- Download file 347 Bytes
-
https://huggingface.co/spaces/lenson78/codex-proxy/resolve/main/src/utils/parse-cookie.ts
- Command line
-
hf download hf://spaces/lenson78/codex-proxy/src/utils/parse-cookie.ts
-
curl -L -o parse-cookie.ts https://huggingface.co/spaces/lenson78/codex-proxy/resolve/main/src/utils/parse-cookie.ts
347 Bytes
| const COOKIE_REGEX = /(?:^|;\s*)_codex_session=([^;]*)/; | |
| /** Extract the _codex_session cookie value from a Cookie header. */ | |
| export function parseSessionCookie(cookieHeader: string | undefined): string | undefined { | |
| if (!cookieHeader) return undefined; | |
| const match = COOKIE_REGEX.exec(cookieHeader); | |
| return match ? match[1] : undefined; | |
| } | |