Skip to content

Commit 4b97412

Browse files
sicarius97himself65
andcommitted
fix(oauth-provider): allow localhost subdomains in isLocalhost function (#8286)
Co-authored-by: Alex Yang <himself65@outlook.com>
1 parent f88bcd7 commit 4b97412

File tree

1 file changed

+4
-1
lines changed
  • packages/oauth-provider/src/types

1 file changed

+4
-1
lines changed

packages/oauth-provider/src/types/zod.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ const DANGEROUS_SCHEMES = ["javascript:", "data:", "vbscript:"];
44

55
function isLocalhost(hostname: string): boolean {
66
return (
7-
hostname === "localhost" || hostname === "127.0.0.1" || hostname === "[::1]"
7+
hostname === "localhost" ||
8+
hostname === "127.0.0.1" ||
9+
hostname === "[::1]" ||
10+
hostname.endsWith(".localhost")
811
);
912
}
1013

0 commit comments

Comments
 (0)