fix: add helper for expected path.Clean behavior (#12068)

current usage of path.Clean returns "." for empty strings
instead we need `""` string as-is, make relevant changes
as needed.
This commit is contained in:
Harshavardhana
2021-04-15 16:32:13 -07:00
committed by GitHub
parent d30c5d1cf0
commit a334554f99
8 changed files with 29 additions and 13 deletions

View File

@@ -23,7 +23,6 @@ import (
"io"
"io/ioutil"
"net/http"
"path"
"sort"
"github.com/gorilla/mux"
@@ -363,7 +362,7 @@ func (a adminAPIHandlers) AddUser(w http.ResponseWriter, r *http.Request) {
defer logger.AuditLog(ctx, w, r, mustGetClaimsFromToken(r))
vars := mux.Vars(r)
accessKey := path.Clean(vars["accessKey"])
accessKey := vars["accessKey"]
// Get current object layer instance.
objectAPI := newObjectLayerFn()