diff --git a/ais/proxy.go b/ais/proxy.go index e0a591f2e1f..91bfc9dd0c6 100644 --- a/ais/proxy.go +++ b/ais/proxy.go @@ -3038,8 +3038,14 @@ func (p *proxy) rootHandler(w http.ResponseWriter, r *http.Request) { } // by default, s3 is serviced at `/s3` - // with `/` root reserved for vanilla http locations via ht:// mechanism if !cmn.Rom.Features().IsSet(feat.S3APIviaRoot) { + config := cmn.GCO.Get() + if config.Backend.Get(apc.HT) == nil { + p.writeErrURL(w, r) + return + } + + // `/` root reserved for vanilla http locations via ht:// mechanism p.htHandler(w, r) return } diff --git a/cmn/http.go b/cmn/http.go index 0ab5503dab4..d80635d5f41 100644 --- a/cmn/http.go +++ b/cmn/http.go @@ -94,13 +94,15 @@ func MakeRangeHdr(start, length int64) string { const maxItems = 1000 func ParseURL(path string, itemsPresent []string, itemsAfter int, splitAfter bool) ([]string, error) { + // path.Clean(string) reduced to this: + for path != "" && path[0] == '/' { + path = path[1:] + } + var ( split []string l = len(itemsPresent) ) - if path != "" && path[0] == '/' { - path = path[1:] // remove leading slash - } if splitAfter { split = strings.SplitN(path, "/", maxItems) } else {