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

Function buildRequest

pkg/signer/request-signature-v4_test.go:39–52  ·  view source on GitHub ↗
(serviceName, region, body string)

Source from the content-addressed store, hash-verified

37}
38
39func buildRequest(serviceName, region, body string) (*http.Request, io.ReadSeeker) {
40 endpoint := "https://" + serviceName + "." + region + ".amazonaws.com"
41 reader := strings.NewReader(body)
42 req, _ := http.NewRequest(http.MethodPost, endpoint, reader)
43 req.URL.Opaque = "//example.org/bucket/key-._~,!@#$%^&*()"
44 req.Header.Add("Accept-Encoding", "identity")
45 req.Header.Add("Content-Type", "application/x-amz-json-1.0")
46 req.Header.Add("Content-Length", fmt.Sprint(len(body)))
47 req.Header.Add("X-Amz-Meta-Other-Header", "some-value=!@#$%^&* (+)")
48 req.Header.Add("X-Amz-Meta-Other-Header_With_Underscore", "some-value=!@#$%^&* (+)")
49 req.Header.Add("X-amz-Meta-Other-Header_With_Underscore", "some-value=!@#$%^&* (+)")
50 req.Header.Add("X-Amz-Target", "prefix.Operation")
51 return req, reader
52}
53
54// TestSignV4OutpostsCredentialScope verifies that SignV4Outposts produces a credential scope containing s3-outposts.
55func TestSignV4OutpostsCredentialScope(t *testing.T) {

Callers 1

TestRequestHostFunction · 0.85

Calls 1

AddMethod · 0.45

Tested by

no test coverage detected