| 37 | } |
| 38 | |
| 39 | func 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. |
| 55 | func TestSignV4OutpostsCredentialScope(t *testing.T) { |