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

Function TestIsAmzHeader

utils_test.go:391–414  ·  view source on GitHub ↗

Tests if header is x-amz-meta or x-amz-acl

(t *testing.T)

Source from the content-addressed store, hash-verified

389
390// Tests if header is x-amz-meta or x-amz-acl
391func 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.
417func TestIsCustomQueryValue(t *testing.T) {

Callers

nothing calls this directly

Calls 1

isAmzHeaderFunction · 0.85

Tested by

no test coverage detected