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

Function getRequestHost

connection/http2.go:427–435  ·  view source on GitHub ↗

getRequestHost returns the host of the http.Request.

(r *http.Request)

Source from the content-addressed store, hash-verified

425
426// getRequestHost returns the host of the http.Request.
427func getRequestHost(r *http.Request) (string, error) {
428 if r.Host != "" {
429 return r.Host, nil
430 }
431 if r.URL != nil {
432 return r.URL.Host, nil
433 }
434 return "", errors.New("host not set in incoming request")
435}

Callers 1

ServeHTTPMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected