mirror of
https://github.com/minio/minio.git
synced 2025-04-20 02:27:50 -04:00
allow prefix filtering for WalkDir to be optional (#10923)
This commit is contained in:
parent
990d074f7d
commit
9dea7020f0
@ -258,12 +258,12 @@ func (s *storageRESTServer) WalkDirHandler(w http.ResponseWriter, r *http.Reques
|
|||||||
vars := mux.Vars(r)
|
vars := mux.Vars(r)
|
||||||
volume := vars[storageRESTVolume]
|
volume := vars[storageRESTVolume]
|
||||||
dirPath := vars[storageRESTDirPath]
|
dirPath := vars[storageRESTDirPath]
|
||||||
prefix := vars[storageRESTPrefixFilter]
|
|
||||||
recursive, err := strconv.ParseBool(vars[storageRESTRecursive])
|
recursive, err := strconv.ParseBool(vars[storageRESTRecursive])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.writeErrorResponse(w, err)
|
s.writeErrorResponse(w, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
prefix := r.URL.Query().Get(storageRESTPrefixFilter)
|
||||||
writer := streamHTTPResponse(w)
|
writer := streamHTTPResponse(w)
|
||||||
writer.CloseWithError(s.storage.WalkDir(r.Context(), WalkDirOptions{
|
writer.CloseWithError(s.storage.WalkDir(r.Context(), WalkDirOptions{
|
||||||
Bucket: volume,
|
Bucket: volume,
|
||||||
|
@ -1083,7 +1083,7 @@ func registerStorageRESTHandlers(router *mux.Router, endpointServerSets Endpoint
|
|||||||
subrouter.Methods(http.MethodPost).Path(storageRESTVersionPrefix + storageRESTMethodVerifyFile).HandlerFunc(httpTraceHdrs(server.VerifyFileHandler)).
|
subrouter.Methods(http.MethodPost).Path(storageRESTVersionPrefix + storageRESTMethodVerifyFile).HandlerFunc(httpTraceHdrs(server.VerifyFileHandler)).
|
||||||
Queries(restQueries(storageRESTVolume, storageRESTFilePath)...)
|
Queries(restQueries(storageRESTVolume, storageRESTFilePath)...)
|
||||||
subrouter.Methods(http.MethodPost).Path(storageRESTVersionPrefix + storageRESTMethodWalkDir).HandlerFunc(httpTraceHdrs(server.WalkDirHandler)).
|
subrouter.Methods(http.MethodPost).Path(storageRESTVersionPrefix + storageRESTMethodWalkDir).HandlerFunc(httpTraceHdrs(server.WalkDirHandler)).
|
||||||
Queries(restQueries(storageRESTVolume, storageRESTDirPath, storageRESTRecursive, storageRESTPrefixFilter)...)
|
Queries(restQueries(storageRESTVolume, storageRESTDirPath, storageRESTRecursive)...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user