mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-26 00:46:44 -05:00
Refactor isLocalhost function for readability
ALso to fix lint error
This commit is contained in:
@@ -4,7 +4,10 @@ const DANGEROUS_SCHEMES = ["javascript:", "data:", "vbscript:"];
|
||||
|
||||
function isLocalhost(hostname: string): boolean {
|
||||
return (
|
||||
hostname === "localhost" || hostname === "127.0.0.1" || hostname === "[::1]" || hostname.endsWith(".localhost")
|
||||
hostname === "localhost"
|
||||
|| hostname === "127.0.0.1"
|
||||
|| hostname === "[::1]"
|
||||
|| hostname.endsWith(".localhost")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user