16950: switch to os.UserHomeDir(), and send all output to stderr.
[arvados.git] / services / keep-web / s3.go
index 4e8028ae6e8de3c429679c7ff25fc87ee58f3cf2..7cd1b1a896e3fa56eaa60db2f5d4851ac9430b39 100644 (file)
@@ -358,6 +358,13 @@ func (h *handler) s3list(w http.ResponseWriter, r *http.Request, fs arvados.Cust
                // CommonPrefixes is nil, which confuses some clients.
                // Fix by using this nested struct instead.
                CommonPrefixes []commonPrefix
+               // Similarly, we need omitempty here, because an empty
+               // tag confuses some clients (e.g.,
+               // github.com/aws/aws-sdk-net never terminates its
+               // paging loop).
+               NextMarker string `xml:"NextMarker,omitempty"`
+               // ListObjectsV2 has a KeyCount response field.
+               KeyCount int
        }
        resp := listResp{
                ListResp: s3.ListResp{
@@ -454,6 +461,7 @@ func (h *handler) s3list(w http.ResponseWriter, r *http.Request, fs arvados.Cust
                }
                sort.Slice(resp.CommonPrefixes, func(i, j int) bool { return resp.CommonPrefixes[i].Prefix < resp.CommonPrefixes[j].Prefix })
        }
+       resp.KeyCount = len(resp.Contents)
        w.Header().Set("Content-Type", "application/xml")
        io.WriteString(w, xml.Header)
        if err := xml.NewEncoder(w).Encode(resp); err != nil {