(scheme, host, port string)
| 156 | } |
| 157 | |
| 158 | func validateIP(scheme, host, port string) (string, error) { |
| 159 | if scheme == "" { |
| 160 | scheme = defaultScheme |
| 161 | } |
| 162 | if port != "" { |
| 163 | return fmt.Sprintf("%s://%s", scheme, net.JoinHostPort(host, port)), nil |
| 164 | } else if strings.Contains(host, ":") { |
| 165 | // IPv6 |
| 166 | return fmt.Sprintf("%s://[%s]", scheme, host), nil |
| 167 | } |
| 168 | return fmt.Sprintf("%s://%s", scheme, host), nil |
| 169 | } |
| 170 | |
| 171 | // Access checks if a JWT from Cloudflare Access is valid. |
| 172 | type Access struct { |