rc: Fix serving bucket based objects with --rc-serve
Before this change serving bucket based objects `[remote:bucket]/path/to/object` would fail with 404 not found. This was because the leading `/` in `/path/to/object` was being passed to NewObject.
This commit is contained in:
@@ -243,6 +243,7 @@ func (s *Server) serveRemote(w http.ResponseWriter, r *http.Request, path string
|
||||
}
|
||||
directory.Serve(w, r)
|
||||
} else {
|
||||
path = strings.Trim(path, "/")
|
||||
o, err := f.NewObject(path)
|
||||
if err != nil {
|
||||
writeError(path, nil, w, errors.Wrap(err, "failed to find object"), http.StatusInternalServerError)
|
||||
|
||||
Reference in New Issue
Block a user