Spaces:
Sleeping
Sleeping
Download src/utils/auth-utils.ts from Bin29/ManimCat-show: direct link, hf CLI and curl.
- Browser
- Download file 471 Bytes
-
https://huggingface.co/spaces/Bin29/ManimCat-show/resolve/main/src/utils/auth-utils.ts
- Command line
-
hf download hf://spaces/Bin29/ManimCat-show/src/utils/auth-utils.ts
-
curl -L -o auth-utils.ts https://huggingface.co/spaces/Bin29/ManimCat-show/resolve/main/src/utils/auth-utils.ts
471 Bytes
| /** | |
| * Bearer 提取。 | |
| * | |
| * 访问控制本身已经搬进 `../access`:这里只剩这一个纯格式工具,不含任何凭据校验。 | |
| */ | |
| export function extractBearerToken(authHeader: string | string[] | undefined): string { | |
| if (!authHeader) return '' | |
| if (typeof authHeader === 'string') { | |
| return authHeader.replace(/^Bearer\s+/i, '') | |
| } | |
| if (Array.isArray(authHeader)) { | |
| return authHeader[0]?.replace(/^Bearer\s+/i, '') || '' | |
| } | |
| return '' | |
| } | |