From 6df3f76b07a027955ccb49ff17d2caca788e6c19 Mon Sep 17 00:00:00 2001 From: Joonas Bergius Date: Sun, 13 Oct 2024 17:03:19 -0500 Subject: [PATCH] fix: Set Content-Length header on monolithic push session request Signed-off-by: Joonas Bergius --- src/client.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/client.rs b/src/client.rs index 5c79d5fc..e0f381c8 100644 --- a/src/client.rs +++ b/src/client.rs @@ -1244,6 +1244,11 @@ impl Client { .apply_auth(image, RegistryOperation::Push) .await? .into_request_builder() + // We set "Content-Length" to 0 here even though the OCI Distribution + // spec does not strictly require that. In practice we have seen that + // certain registries require "Content-Length" to be present for all + // types of push sessions. + .header("Content-Length", 0) .send() .await?;