Skip to content

Commit

Permalink
Simplify the check for the xrss header
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Arnold <[email protected]>
  • Loading branch information
mattarnoatibm committed Oct 10, 2023
1 parent e147247 commit 6d96349
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions image-rs/src/signature/mechanism/simple/xrss.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,7 @@ impl RegistryClient {
.await
.context("Failed to query extensions supported by registry v2 endpoint")?;

let registry_signature_support_header = res.headers().get("x-registry-supports-signatures");
if registry_signature_support_header.is_some()
&& registry_signature_support_header.unwrap() == "1"
{
if res.headers().get("x-registry-supports-signatures") == Some("1") {

Check failure on line 109 in image-rs/src/signature/mechanism/simple/xrss.rs

View workflow job for this annotation

GitHub Actions / Check (stable)

mismatched types

Check failure on line 109 in image-rs/src/signature/mechanism/simple/xrss.rs

View workflow job for this annotation

GitHub Actions / Check (nightly)

mismatched types

Check failure on line 109 in image-rs/src/signature/mechanism/simple/xrss.rs

View workflow job for this annotation

GitHub Actions / Check (1.72.0)

mismatched types
let oauth_token = self.get_oauth_token_for_registry(image, auth).await?;
let res = self
.client
Expand All @@ -129,7 +126,7 @@ impl RegistryClient {

for registry_signature in signatures_response_body.signatures.iter() {
let signature = base64::engine::general_purpose::STANDARD.decode(&registry_signature.content).context(
"Error when decoding sognature from registry. Signature is not base64 encoded",
"Error when decoding sognature from registry. Signature is not base64 encoded"
)?;
sigs.push(signature);
}
Expand Down

0 comments on commit 6d96349

Please sign in to comment.