Tests if header is x-amz-meta or x-amz-acl
(t *testing.T)
| 389 | |
| 390 | // Tests if header is x-amz-meta or x-amz-acl |
| 391 | func TestIsAmzHeader(t *testing.T) { |
| 392 | testCases := []struct { |
| 393 | // Input. |
| 394 | header string |
| 395 | // Expected result. |
| 396 | expectedValue bool |
| 397 | }{ |
| 398 | {"x-amz-iv", false}, |
| 399 | {"x-amz-key", false}, |
| 400 | {"x-amz-matdesc", false}, |
| 401 | {"x-amz-meta-x-amz-iv", true}, |
| 402 | {"x-amz-meta-x-amz-key", true}, |
| 403 | {"x-amz-meta-x-amz-matdesc", true}, |
| 404 | {"x-amz-acl", true}, |
| 405 | {"random-header", false}, |
| 406 | } |
| 407 | |
| 408 | for i, testCase := range testCases { |
| 409 | actual := isAmzHeader(testCase.header) |
| 410 | if actual != testCase.expectedValue { |
| 411 | t.Errorf("Test %d: Expected to pass, but failed", i+1) |
| 412 | } |
| 413 | } |
| 414 | } |
| 415 | |
| 416 | // Tests if query parameter starts with "x-" and will be ignored by S3. |
| 417 | func TestIsCustomQueryValue(t *testing.T) { |
nothing calls this directly
no test coverage detected