From 033ec8be44b4b43e5e9d0da1f906cfea08f0b561 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 --- daemon/server/router/image/image_routes.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/daemon/server/router/image/image_routes.go b/daemon/server/router/image/image_routes.go index ec8647e962..57cd8bb92a 100644 --- a/daemon/server/router/image/image_routes.go +++ b/daemon/server/router/image/image_routes.go @@ -166,14 +166,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()