mirror of
https://github.com/LemmyNet/activitypub-federation-rust.git
synced 2024-06-09 00:39:29 +00:00
debug signed fetch
This commit is contained in:
parent
147f144769
commit
294c77c01b
|
@ -106,6 +106,7 @@ async fn fetch_object_http_with_accept<T: Clone, Kind: DeserializeOwned>(
|
||||||
data.config.http_signature_compat,
|
data.config.http_signature_compat,
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
dbg!(req.headers());
|
||||||
config.client.execute(req).await?
|
config.client.execute(req).await?
|
||||||
} else {
|
} else {
|
||||||
req.send().await?
|
req.send().await?
|
||||||
|
@ -119,6 +120,7 @@ async fn fetch_object_http_with_accept<T: Clone, Kind: DeserializeOwned>(
|
||||||
let content_type = res.headers().get("Content-Type").cloned();
|
let content_type = res.headers().get("Content-Type").cloned();
|
||||||
let text = res.bytes_limited().await?;
|
let text = res.bytes_limited().await?;
|
||||||
let object_id = extract_id(&text).ok();
|
let object_id = extract_id(&text).ok();
|
||||||
|
dbg!(String::from_utf8(text.to_vec()));
|
||||||
|
|
||||||
match serde_json::from_slice(&text) {
|
match serde_json::from_slice(&text) {
|
||||||
Ok(object) => Ok(FetchObjectResponse {
|
Ok(object) => Ok(FetchObjectResponse {
|
||||||
|
|
|
@ -106,6 +106,7 @@ pub(crate) async fn sign_request(
|
||||||
Sha256::new(),
|
Sha256::new(),
|
||||||
activity,
|
activity,
|
||||||
move |signing_string| {
|
move |signing_string| {
|
||||||
|
dbg!(&signing_string);
|
||||||
let mut signer = Signer::new(MessageDigest::sha256(), &private_key)?;
|
let mut signer = Signer::new(MessageDigest::sha256(), &private_key)?;
|
||||||
signer.update(signing_string.as_bytes())?;
|
signer.update(signing_string.as_bytes())?;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue