diff --git a/apub-awc/src/lib.rs b/apub-awc/src/lib.rs index 929753b..d0e792f 100644 --- a/apub-awc/src/lib.rs +++ b/apub-awc/src/lib.rs @@ -100,11 +100,11 @@ where async fn do_fetch( &self, - id: &Id, + url: &Url, ) -> Result::Output>, AwcError>> { let mut response = self .client - .get(id.url().as_str()) + .get(url.as_str()) .insert_header(("Accept", "application/activity+json")) .insert_header(("Date", HttpDate::from(SystemTime::now()))) .signature(self.config.clone(), self.crypto.key_id(), { @@ -132,12 +132,10 @@ where Box::Output>, Self::Error>> + 'a>, >; - fn fetch(&'a self, id: &'a Id) -> Self::Future { - Box::pin(apub_core::session::guard( - self.do_fetch(id), - id.url(), - &self.session, - )) + fn fetch(&'a self, id: Id) -> Self::Future { + Box::pin(async move { + apub_core::session::guard(self.do_fetch::(id.url()), id.url(), &self.session).await + }) } }