fix: various lint issues (#2571)

Originally found by @jkroepke in: https://github.com/project-zot/zot/actions/runs/10056774230/job/27796324933?pr=2556
And https://github.com/project-zot/zot/pull/2556 in general

This commit covers:
- (canonicalheader) capitalization of Docker-Content-Digest header
- (protogetter) the proto getters were not used, they check for nil pointers, we should switch to using them
- (zerologlint) fix the false positive

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
This commit is contained in:
Andrei Aaron
2024-07-25 20:14:22 +03:00
committed by GitHub
parent 048e59186f
commit 7d87558b7e
5 changed files with 156 additions and 168 deletions
+1 -1
View File
@@ -89,7 +89,7 @@ func SessionLogger(ctlr *Controller) mux.MiddlewareFunc {
clientIP := request.RemoteAddr
method := request.Method
headers := map[string][]string{}
log := logger.Info()
log := logger.Info() //nolint: zerologlint // false positive, the Msg call is below
for key, value := range request.Header {
if key == "Authorization" { // anonymize from logs
s := strings.SplitN(value[0], " ", 2) //nolint:gomnd