Skip to content

Commit

Permalink
Merge pull request #20 from thomassa/ts/fix-missing-final-quote-APPS-874
Browse files Browse the repository at this point in the history
Add missing final quote to authorization header
  • Loading branch information
thomassa authored May 24, 2023
2 parents c12e3aa + 38f9505 commit 83d77a2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "http-sig"
description = "Implementation of the IETF draft 'Signing HTTP Messages'"
version = "0.4.1"
version = "0.5.0"
authors = ["Jack Cargill <[email protected]>", "Diggory Blake"]
edition = "2018"
readme = "README.md"
Expand Down
4 changes: 2 additions & 2 deletions src/algorithm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl HttpDigest for Sha256 {
"SHA-256"
}
fn http_digest(&self, bytes_to_digest: &[u8]) -> String {
base64::encode(&Self::digest(bytes_to_digest))
base64::encode(Self::digest(bytes_to_digest))
}
}

Expand All @@ -89,7 +89,7 @@ impl HttpDigest for Sha512 {
"SHA-512"
}
fn http_digest(&self, bytes_to_digest: &[u8]) -> String {
base64::encode(&Self::digest(bytes_to_digest))
base64::encode(Self::digest(bytes_to_digest))
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/reqwest_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ mod tests {

let with_sig = without_sig.signed(&config).unwrap();

assert_eq!(with_sig.headers().get(AUTHORIZATION).unwrap(), "Signature keyId=\"test_key\",algorithm=\"hs2019\",signature=\"F8gZiriO7dtKFiP5eSZ+Oh1h61JIrAR6D5Mdh98DjqA=\",headers=\"(request-target) host date digest");
assert_eq!(with_sig.headers().get(AUTHORIZATION).unwrap(), "Signature keyId=\"test_key\",algorithm=\"hs2019\",signature=\"F8gZiriO7dtKFiP5eSZ+Oh1h61JIrAR6D5Mdh98DjqA=\",headers=\"(request-target) host date digest\"");
assert_eq!(
with_sig
.headers()
Expand Down
2 changes: 1 addition & 1 deletion src/signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ impl<R: ClientRequestLike> SigningExt for R {

// Construct the authorization header
let auth_header = format!(
r#"Signature keyId="{}",algorithm="{}",signature="{}",headers="{}"#,
r#"Signature keyId="{}",algorithm="{}",signature="{}",headers="{}""#,
config.key_id, "hs2019", signature, joined_headers
);

Expand Down

0 comments on commit 83d77a2

Please sign in to comment.