(value: string)
| 116 | } |
| 117 | |
| 118 | export const isLoopbackHttpUrl = (value: string): boolean => { |
| 119 | if (!URL.canParse(value)) return false; |
| 120 | const url = new URL(value); |
| 121 | if (url.protocol !== "http:") return false; |
| 122 | const hostname = url.hostname.toLowerCase(); |
| 123 | return ( |
| 124 | hostname === "localhost" || |
| 125 | hostname === "0.0.0.0" || |
| 126 | hostname === "::1" || |
| 127 | hostname === "[::1]" || |
| 128 | hostname.startsWith("127.") |
| 129 | ); |
| 130 | }; |
| 131 | |
| 132 | export const isSupportedOAuthEndpointUrl = ( |
| 133 | value: string, |
no outgoing calls
no test coverage detected