validate if cached value is empty before use (#13830)

fixes a crash reproduced while running hadoop tests

```
goroutine 201564 [running]:
github.com/minio/minio/cmd.metaCacheEntries.resolve({0xc0206ab7a0, 0x4, 0xc0015b1908}, 0xc0212a7040)
	github.com/minio/minio/cmd/metacache-entries.go:352 +0x58a
```

Bonus: HeadBucket() should always provide content-type
This commit is contained in:
Harshavardhana
2021-12-06 02:59:51 -08:00
committed by GitHub
parent be34fc9134
commit b120bcb60a
3 changed files with 11 additions and 3 deletions

View File

@@ -1210,7 +1210,7 @@ func (api objectAPIHandlers) HeadBucketHandler(w http.ResponseWriter, r *http.Re
return
}
writeSuccessResponseHeadersOnly(w)
writeResponse(w, http.StatusOK, nil, mimeXML)
}
// DeleteBucketHandler - Delete bucket