Skip to content

Commit

Permalink
Join subdir to base pj URL to preserve path (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanGould authored Dec 29, 2024
2 parents b4a4b03 + df9c5b8 commit e54e51f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions payjoin/src/send/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,12 +411,12 @@ impl V2GetContext {
ohttp_relay: Url,
) -> Result<(Request, ohttp::ClientResponse), CreateRequestError> {
use crate::uri::UrlExt;
let mut url = self.endpoint.clone();
let base_url = self.endpoint.clone();

// TODO unify with receiver's fn subdir_path_from_pubkey
let hash = sha256::Hash::hash(&self.hpke_ctx.reply_pair.public_key().to_compressed_bytes());
let subdir: ShortId = hash.into();
url.set_path(&subdir.to_string());
let url = base_url.join(&subdir.to_string()).map_err(InternalCreateRequestError::Url)?;
let body = encrypt_message_a(
Vec::new(),
&self.hpke_ctx.reply_pair.public_key().clone(),
Expand Down

0 comments on commit e54e51f

Please sign in to comment.