19249: Add test for control chars in properties key. 19249-header-ctrl-chars
authorTom Clegg <tom@curii.com>
Mon, 11 Jul 2022 15:17:17 +0000 (11:17 -0400)
committerTom Clegg <tom@curii.com>
Mon, 11 Jul 2022 15:17:17 +0000 (11:17 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

services/keep-web/s3_test.go

index 14dfa62dba6c0272628f86930d59d33e44fe3b8c..851bee4b72f0449012c027e96cfefa4503c861b1 100644 (file)
@@ -83,6 +83,10 @@ func (s *IntegrationSuite) s3setup(c *check.C) s3stage {
                        "object":   map[string]interface{}{"key": map[string]interface{}{"key2": "value⛵"}},
                        "nonascii": "⛵",
                        "newline":  "foo\r\nX-Bad: header",
+                       // This key cannot be expressed as a MIME
+                       // header key, so it will be silently skipped
+                       // (see "Inject" in PropertiesAsMetadata test)
+                       "a: a\r\nInject": "bogus",
                },
        }})
        c.Assert(err, check.IsNil)
@@ -281,6 +285,7 @@ func (s *IntegrationSuite) TestS3PropertiesAsMetadata(c *check.C) {
        rdr.Close()
        c.Check(content, check.HasLen, 4)
        s.checkMetaEquals(c, hdr, expectCollectionTags)
+       c.Check(hdr["Inject"], check.IsNil)
 
        c.Log("HEAD bucket with metadata from collection")
        resp, err = stage.collbucket.Head("/", nil)