MCPcopy
hub / github.com/minio/minio-go / getHostAddr

Function getHostAddr

pkg/signer/utils.go:45–54  ·  view source on GitHub ↗

getHostAddr returns host header if available, otherwise returns host from URL

(req *http.Request)

Source from the content-addressed store, hash-verified

43
44// getHostAddr returns host header if available, otherwise returns host from URL
45func getHostAddr(req *http.Request) string {
46 host := req.Header.Get("host")
47 if host != "" && req.Host != host {
48 return host
49 }
50 if req.Host != "" {
51 return req.Host
52 }
53 return req.URL.Host
54}
55
56// Trim leading and trailing spaces and replace sequential spaces with one space, following Trimall()
57// in http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html

Callers 3

encodeURL2PathFunction · 0.85
PreSignV2Function · 0.85
getCanonicalHeadersFunction · 0.85

Calls 1

GetMethod · 0.45

Tested by

no test coverage detected