From 8d2740dc7d3b4a238985d3b4508f2a9e14a9e376 Mon Sep 17 00:00:00 2001 From: Sergio <77530549+sergi0g@users.noreply.github.com> Date: Fri, 30 Aug 2024 19:17:43 +0300 Subject: [PATCH] Set correct headers when requesting a manifest to prevent getting a v1 manifest --- src/registry.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/registry.rs b/src/registry.rs index ffa659e..77359a1 100644 --- a/src/registry.rs +++ b/src/registry.rs @@ -29,7 +29,7 @@ pub fn get_latest_digest(image: &Image, token: Option<&String>) -> Image { request = request.set("Authorization", &format!("Bearer {}", t)); } let raw_response = match request - .set("Accept", "application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.oci.image.index.v1+json") + .set("Accept", "application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.docker.distribution.manifest.v2+json, application/vnd.oci.image.index.v1+json") .call() { Ok(response) => response, @@ -82,7 +82,7 @@ pub fn get_token(images: Vec<&Image>, auth_url: &str) -> String { final_url = format!("{}&scope=repository:{}:pull", final_url, image.repository); } let raw_response = match ureq::get(&final_url) - .set("Accept", "application/vnd.oci.image.index.v1+json") + .set("Accept", "application/vnd.oci.image.index.v1+json") // Seems to be unnecesarry. Will probably remove in the future .call() { Ok(response) => match response.into_string() {