(value: string)
| 142 | } |
| 143 | |
| 144 | export const isLoopbackHttpUrl = (value: string): boolean => { |
| 145 | if (!URL.canParse(value)) return false; |
| 146 | const url = new URL(value); |
| 147 | if (url.protocol !== "http:") return false; |
| 148 | const hostname = url.hostname.toLowerCase(); |
| 149 | return ( |
| 150 | hostname === "localhost" || |
| 151 | hostname === "0.0.0.0" || |
| 152 | hostname === "::1" || |
| 153 | hostname === "[::1]" || |
| 154 | hostname.startsWith("127.") |
| 155 | ); |
| 156 | }; |
| 157 | |
| 158 | export const isSupportedOAuthEndpointUrl = ( |
| 159 | value: string, |
no outgoing calls
no test coverage detected