Skip to content

Commit

Permalink
fix: Set Content-Length header on monolithic push session request
Browse files Browse the repository at this point in the history
Signed-off-by: Joonas Bergius <[email protected]>
  • Loading branch information
joonas committed Oct 22, 2024
1 parent abba4b5 commit 6df3f76
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;

Expand Down

0 comments on commit 6df3f76

Please sign in to comment.