Skip to content

Commit

Permalink
Merge pull request #176 from joonas/fix/set-content-length-for-monoli…
Browse files Browse the repository at this point in the history
…thic-sessions

fix: Set Content-Length header on monolithic push session request
  • Loading branch information
flavio authored Oct 24, 2024
2 parents 19f589e + 6df3f76 commit 7c75c33
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 7c75c33

Please sign in to comment.