Minor cleanup and fixes

- Do not allow '.' as path component, because it undermines depth
  checks, and add tests
- Fix GiB reporting
- Fix metrics label
- Helper function for http errors
This commit is contained in:
Konrad Wojas
2020-05-31 21:36:39 +08:00
committed by Alexander Neumann
parent 1f593fafaf
commit d4cd47e503
5 changed files with 41 additions and 18 deletions

View File

@@ -63,7 +63,7 @@ func makeBlobMetricFunc(username string, folderPath []string) repo.BlobMetricFun
var f repo.BlobMetricFunc = func(objectType string, operation repo.BlobOperation, nBytes uint64) {
labels := prometheus.Labels{
"user": username,
"repo": strings.Join(folderPath, ""),
"repo": strings.Join(folderPath, "/"),
"type": objectType,
}
switch operation {