@@ -415,8 +415,8 @@ pub async fn pull_devcontainer_index<P: AsRef<Path>>(filename: P) -> Result<()>
415415 log:: debug!( "pull_devcontainer_index" ) ;
416416
417417 let image: OciReference = "ghcr.io/devcontainers/index:latest" . parse ( ) ?;
418- let accepted_media_types = vec ! [ "application/vnd.devcontainers.index.layer.v1+json" ] ;
419- let blob = get_layer_bytes ( & image, accepted_media_types )
418+ let media_type = "application/vnd.devcontainers.index.layer.v1+json" ;
419+ let blob = get_layer_bytes ( & image, media_type )
420420 . await
421421 . context ( "Failed to pull devcontainer index" ) ?;
422422 let mut file = File :: create ( filename) ?;
@@ -432,8 +432,8 @@ pub async fn pull_devcontainer_index<P: AsRef<Path>>(filename: P) -> Result<()>
432432pub async fn pull_archive_bytes ( image : & OciReference ) -> Result < Vec < u8 > > {
433433 log:: debug!( "pull_archive_bytes" ) ;
434434
435- let accepted_media_types = vec ! [ "application/vnd.devcontainers.layer.v1+tar" ] ;
436- let blob = get_layer_bytes ( image, accepted_media_types )
435+ let media_type = "application/vnd.devcontainers.layer.v1+tar" ;
436+ let blob = get_layer_bytes ( image, media_type )
437437 . await
438438 . context ( "Failed to pull archive bytes" ) ?;
439439
@@ -442,9 +442,10 @@ pub async fn pull_archive_bytes(image: &OciReference) -> Result<Vec<u8>> {
442442 Ok ( blob)
443443}
444444
445- async fn get_layer_bytes ( OciReference ( image) : & OciReference , accepted_media_types : Vec < & str > ) -> Result < Vec < u8 > > {
445+ async fn get_layer_bytes ( OciReference ( image) : & OciReference , media_type : & str ) -> Result < Vec < u8 > > {
446446 let auth = RegistryAuth :: Anonymous ;
447447 let client = Client :: new ( Default :: default ( ) ) ;
448+ let accepted_media_types = vec ! [ media_type] ;
448449 let image_data = client
449450 . pull ( image, & auth, accepted_media_types)
450451 . await
0 commit comments