Skip to content

Commit 1dc2068

Browse files
committed
Document the scope of isLocalHost
Add a short block comment above isLocalHost spelling out what the function does and does not do: it's a string-equality check between hostnames, with no DNS resolution and no authority over the request itself. This mirrors the AGENTS.md convention of documenting the limits of security-adjacent checks so a future reader doesn't mistake it for a gatekeeper. No behavior change. #484 (comment) Assisted-by: Claude Code:claude-opus-4-7
1 parent 1ddd002 commit 1dc2068

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/instance-host.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ export function getInstanceHost(fallback: URL | string): string {
1111
return typeof fallback === "string" ? fallback : fallback.host;
1212
}
1313

14+
// String-equality check between hostnames; no DNS resolution and no
15+
// authority over the request itself. Used by lookup paths to decide
16+
// whether a handle's host segment refers to this instance.
1417
export function isLocalHost(host: string, requestUrl: URL): boolean {
1518
const lower = host.toLowerCase();
1619
// Accept both request URL forms: .host (with port) covers

0 commit comments

Comments
 (0)