From 8a89fe5c196cc11aa1e44fca098776cbab6a99a2 Mon Sep 17 00:00:00 2001 From: Tiago Teixeira Date: Thu, 14 Aug 2025 11:05:45 +0200 Subject: [PATCH] daemon/router/image: initialize default authConfig Signed-off-by: Tiago Teixeira (cherry picked from commit 033ec8be44b4b43e5e9d0da1f906cfea08f0b561) Signed-off-by: Sebastiaan van Stijn --- api/server/router/image/image_routes.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/api/server/router/image/image_routes.go b/api/server/router/image/image_routes.go index dfbb6959f9..a943100af3 100644 --- a/api/server/router/image/image_routes.go +++ b/api/server/router/image/image_routes.go @@ -167,14 +167,11 @@ func (ir *imageRouter) postImagesPush(ctx context.Context, w http.ResponseWriter return err } - var authConfig *registry.AuthConfig - if authEncoded := r.Header.Get(registry.AuthHeader); authEncoded != "" { - // Handle the authConfig as a header, but ignore invalid AuthConfig - // to increase compatibility with the existing API. - // - // TODO(thaJeztah): accept empty values but return an error when failing to decode. - authConfig, _ = registry.DecodeAuthConfig(authEncoded) - } + // Handle the authConfig as a header, but ignore invalid AuthConfig + // to increase compatibility with the existing API. + // + // TODO(thaJeztah): accept empty values but return an error when failing to decode. + authConfig, _ := registry.DecodeAuthConfig(r.Header.Get(registry.AuthHeader)) output := ioutils.NewWriteFlusher(w) defer output.Close()