Spaces:
Sleeping
Sleeping
Download src/utils/is-localhost.ts from navalmen007/spicta: direct link, hf CLI and curl.
- Browser
- Download file 267 Bytes
-
https://huggingface.co/spaces/navalmen007/spicta/resolve/main/src/utils/is-localhost.ts
- Command line
-
hf download hf://spaces/navalmen007/spicta/src/utils/is-localhost.ts
-
curl -L -o is-localhost.ts https://huggingface.co/spaces/navalmen007/spicta/resolve/main/src/utils/is-localhost.ts
267 Bytes
| const LOCALHOST_ADDRS = new Set(["", "127.0.0.1", "::1", "::ffff:127.0.0.1"]); | |
| /** Returns true if the remote address represents a localhost connection. */ | |
| export function isLocalhostRequest(remoteAddr: string): boolean { | |
| return LOCALHOST_ADDRS.has(remoteAddr); | |
| } | |