Skip to content

Commit fdcc0a6

Browse files
authored
Merge pull request #97 from cgwalters/getblob-no-u64
Ignore size value from GetBlob
2 parents 3b2bc1d + 24d459f commit fdcc0a6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/imageproxy.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,9 +646,12 @@ impl ImageProxy {
646646
tracing::debug!("fetching blob");
647647
let args: Vec<serde_json::Value> =
648648
vec![img.0.into(), digest.to_string().into(), size.into()];
649-
let (bloblen, pipe): (u64, FinishPipe) =
649+
// Note that size may be -1 here if e.g. the remote registry doesn't give a Content-Length
650+
// for example.
651+
// We have always validated the size later (in FinishPipe) so out of conservatism we
652+
// just ignore the size here.
653+
let (_bloblen, pipe): (serde_json::Number, FinishPipe) =
650654
self.impl_request_with_fds("GetBlob", args).await?;
651-
let _: u64 = bloblen;
652655
let fd = tokio::fs::File::from_std(std::fs::File::from(pipe.datafd));
653656
let fd = tokio::io::BufReader::new(fd);
654657
let finish = Box::pin(self.finish_pipe(pipe.pipeid));

0 commit comments

Comments
 (0)