(value: string)
| 132 | } |
| 133 | |
| 134 | export const isLoopbackHttpUrl = (value: string): boolean => { |
| 135 | if (!URL.canParse(value)) return false; |
| 136 | const url = new URL(value); |
| 137 | if (url.protocol !== "http:") return false; |
| 138 | const hostname = url.hostname.toLowerCase(); |
| 139 | return ( |
| 140 | hostname === "localhost" || |
| 141 | hostname === "0.0.0.0" || |
| 142 | hostname === "::1" || |
| 143 | hostname === "[::1]" || |
| 144 | hostname.startsWith("127.") |
| 145 | ); |
| 146 | }; |
| 147 | |
| 148 | export const isSupportedOAuthEndpointUrl = ( |
| 149 | value: string, |
no outgoing calls
no test coverage detected