MCPcopy Index your code
hub / github.com/cloudflare/cloudflared / validateIP

Function validateIP

validation/validation.go:158–169  ·  view source on GitHub ↗
(scheme, host, port string)

Source from the content-addressed store, hash-verified

156}
157
158func 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.
172type Access struct {

Callers 1

validateUrlStringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected