Skip to content

Commit

Permalink
return empty array if there are no objects to list
Browse files Browse the repository at this point in the history
Previously "null" was returned, which does not match the REST backend
specification.
  • Loading branch information
MichaelEischer committed Jun 16, 2023
1 parent dbb2d46 commit beb251d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions repo/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,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() {
Expand Down Expand Up @@ -435,7 +435,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() {
Expand Down

0 comments on commit beb251d

Please sign in to comment.