Skip to content

Commit

Permalink
Improve invalid cache request error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mostynb committed Aug 9, 2023
1 parent d94e38e commit 61e993c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func NewHTTPCache(cache disk.Cache, accessLogger cache.Logger, errorLogger cache
func parseRequestURL(url string, validateAC bool) (kind cache.EntryKind, hash string, instance string, err error) {
m := blobNameSHA256.FindStringSubmatch(url)
if m == nil {
err := fmt.Errorf("resource name must be a SHA256 hash in hex. "+
err := fmt.Errorf("resource name must be a SHA256 hash in hex, "+
"got '%s'", html.EscapeString(url))
return 0, "", "", err
}
Expand All @@ -100,7 +100,7 @@ func parseRequestURL(url string, validateAC bool) (kind cache.EntryKind, hash st

parts := m[2:]
if len(parts) != 2 {
err := fmt.Errorf("the path '%s' is invalid. expected (ac/|cas/)sha256",
err := fmt.Errorf("the path '%s' is invalid, expected (ac/|cas/)sha256",
html.EscapeString(url))
return 0, "", "", err
}
Expand Down

0 comments on commit 61e993c

Please sign in to comment.