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

Function TestRequestHost

pkg/signer/request-signature-v4_test.go:28–37  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

26)
27
28func TestRequestHost(t *testing.T) {
29 req, _ := buildRequest("dynamodb", "us-east-1", "{}")
30 req.URL.RawQuery = "Foo=z&Foo=o&Foo=m&Foo=a"
31 req.Host = "myhost"
32 canonicalHeaders := getCanonicalHeaders(*req, v4IgnoredHeaders)
33
34 if !strings.Contains(canonicalHeaders, "host:"+req.Host) {
35 t.Errorf("canonical host header invalid")
36 }
37}
38
39func buildRequest(serviceName, region, body string) (*http.Request, io.ReadSeeker) {
40 endpoint := "https://" + serviceName + "." + region + ".amazonaws.com"

Callers

nothing calls this directly

Calls 3

buildRequestFunction · 0.85
getCanonicalHeadersFunction · 0.85
ContainsMethod · 0.45

Tested by

no test coverage detected