(value: string)
| 63 | } |
| 64 | |
| 65 | export const isLoopbackHttpUrl = (value: string): boolean => { |
| 66 | if (!URL.canParse(value)) return false; |
| 67 | const url = new URL(value); |
| 68 | if (url.protocol !== "http:") return false; |
| 69 | const hostname = url.hostname.toLowerCase(); |
| 70 | return ( |
| 71 | hostname === "localhost" || |
| 72 | hostname === "0.0.0.0" || |
| 73 | hostname === "::1" || |
| 74 | hostname === "[::1]" || |
| 75 | hostname.startsWith("127.") |
| 76 | ); |
| 77 | }; |
| 78 | |
| 79 | export const isSupportedOAuthEndpointUrl = ( |
| 80 | value: string, |
no outgoing calls
no test coverage detected