[arvados] created: 2.1.0-2700-g13736aa4f

git repository hosting git at public.arvados.org
Mon Jul 11 15:09:05 UTC 2022


        at  13736aa4f0feea65abce2aedc7c4ca0d18e01061 (commit)


commit 13736aa4f0feea65abce2aedc7c4ca0d18e01061
Author: Tom Clegg <tom at curii.com>
Date:   Mon Jul 11 11:08:00 2022 -0400

    19249: Mime-encode metadata headers that have control chars.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/services/keep-web/s3.go b/services/keep-web/s3.go
index 90b75f8a3..1f458f8e5 100644
--- a/services/keep-web/s3.go
+++ b/services/keep-web/s3.go
@@ -607,7 +607,7 @@ func (h *handler) serveS3(w http.ResponseWriter, r *http.Request) bool {
 func setFileInfoHeaders(header http.Header, fs arvados.CustomFileSystem, path string) error {
 	maybeEncode := func(s string) string {
 		for _, c := range s {
-			if c > '\u007f' {
+			if c > '\u007f' || c < ' ' {
 				return mime.BEncoding.Encode("UTF-8", s)
 			}
 		}
diff --git a/services/keep-web/s3_test.go b/services/keep-web/s3_test.go
index 21ad974bb..14dfa62db 100644
--- a/services/keep-web/s3_test.go
+++ b/services/keep-web/s3_test.go
@@ -259,7 +259,7 @@ func (s *IntegrationSuite) TestS3PropertiesAsMetadata(c *check.C) {
 		"Array":    `["element1","element2"]`,
 		"Object":   mime.BEncoding.Encode("UTF-8", `{"key":{"key2":"value⛵"}}`),
 		"Nonascii": "=?UTF-8?b?4pu1?=",
-		"Newline":  "foo  X-Bad: header",
+		"Newline":  mime.BEncoding.Encode("UTF-8", "foo\r\nX-Bad: header"),
 	}
 	expectSubprojectTags := map[string]string{
 		"Subproject_properties_key": "subproject properties value",

commit df17ea1c927da5ac2955e9cc83b6d7ab88085fdb
Author: Tom Clegg <tom at curii.com>
Date:   Mon Jul 11 11:03:12 2022 -0400

    19249: Test handling of crlf for properties rendered in headers.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/services/keep-web/s3_test.go b/services/keep-web/s3_test.go
index a99f3c278..21ad974bb 100644
--- a/services/keep-web/s3_test.go
+++ b/services/keep-web/s3_test.go
@@ -82,6 +82,7 @@ func (s *IntegrationSuite) s3setup(c *check.C) s3stage {
 			"array":    []string{"element1", "element2"},
 			"object":   map[string]interface{}{"key": map[string]interface{}{"key2": "value⛵"}},
 			"nonascii": "⛵",
+			"newline":  "foo\r\nX-Bad: header",
 		},
 	}})
 	c.Assert(err, check.IsNil)
@@ -258,6 +259,7 @@ func (s *IntegrationSuite) TestS3PropertiesAsMetadata(c *check.C) {
 		"Array":    `["element1","element2"]`,
 		"Object":   mime.BEncoding.Encode("UTF-8", `{"key":{"key2":"value⛵"}}`),
 		"Nonascii": "=?UTF-8?b?4pu1?=",
+		"Newline":  "foo  X-Bad: header",
 	}
 	expectSubprojectTags := map[string]string{
 		"Subproject_properties_key": "subproject properties value",

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list