16535: Set header Content-Type: application/xml.
authorTom Clegg <tom@tomclegg.ca>
Thu, 30 Jul 2020 19:21:19 +0000 (15:21 -0400)
committerTom Clegg <tom@tomclegg.ca>
Thu, 30 Jul 2020 19:21:19 +0000 (15:21 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@tomclegg.ca>

services/keep-web/s3.go

index 7c3aedff3c443faecbf306d0671f971c70a5fddf..bc43c524369c819bbf13a208591e8a5128515a7b 100644 (file)
@@ -70,6 +70,7 @@ func (h *handler) serveS3(w http.ResponseWriter, r *http.Request) bool {
                // Path is "/{uuid}" or "/{uuid}/", has no object name
                if _, ok := r.URL.Query()["versioning"]; ok {
                        // GetBucketVersioning
+                       w.Header().Set("Content-Type", "application/xml")
                        fmt.Fprintln(w, `<VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"/>`)
                } else {
                        // ListObjects
@@ -305,6 +306,7 @@ func (h *handler) s3list(w http.ResponseWriter, r *http.Request, fs arvados.Cust
                        sort.Strings(resp.CommonPrefixes)
                }
        }
+       w.Header().Set("Content-Type", "application/xml")
        if err := xml.NewEncoder(w).Encode(resp); err != nil {
                ctxlog.FromContext(r.Context()).WithError(err).Error("error writing xml response")
        }