17009: Fix bucket-level ops using virtual host-style requests.
authorTom Clegg <tom@tomclegg.ca>
Wed, 25 Nov 2020 17:14:34 +0000 (12:14 -0500)
committerPeter Amstutz <peter.amstutz@curii.com>
Fri, 12 Feb 2021 15:22:39 +0000 (10:22 -0500)
refs #17009

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@tomclegg.ca>

services/keep-web/s3.go

index 57c9d7efb30a88bc7b5d69049087d91f9aa3c5e9..117389c4a82c94d0276776324c1d11a715202141 100644 (file)
@@ -209,7 +209,7 @@ func (h *handler) serveS3(w http.ResponseWriter, r *http.Request) bool {
        fspath := "/by_id"
        if id := parseCollectionIDFromDNSName(r.Host); id != "" {
                fspath += "/" + id
-               objectNameGiven = true
+               objectNameGiven = strings.Count(strings.TrimSuffix(r.URL.Path, "/"), "/") > 0
        } else {
                objectNameGiven = strings.Count(strings.TrimSuffix(r.URL.Path, "/"), "/") > 1
        }