mirror of
https://github.com/restic/rest-server.git
synced 2025-12-06 17:15:45 -08:00
return empty array if there are no objects to list
Previously "null" was returned, which does not match the REST backend specification.
This commit is contained in:
@@ -375,7 +375,7 @@ func (h *Handler) listBlobsV1(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
var names []string
|
||||
names := []string{}
|
||||
for _, i := range items {
|
||||
if isHashed(objectType) {
|
||||
if !i.IsDir() {
|
||||
@@ -434,7 +434,7 @@ func (h *Handler) listBlobsV2(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
var blobs []Blob
|
||||
blobs := []Blob{}
|
||||
for _, i := range items {
|
||||
if isHashed(objectType) {
|
||||
if !i.IsDir() {
|
||||
|
||||
Reference in New Issue
Block a user