Skip to content

Commit e54e51f

Browse files
authored
Join subdir to base pj URL to preserve path (payjoin#448)
2 parents b4a4b03 + df9c5b8 commit e54e51f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

payjoin/src/send/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,12 +411,12 @@ impl V2GetContext {
411411
ohttp_relay: Url,
412412
) -> Result<(Request, ohttp::ClientResponse), CreateRequestError> {
413413
use crate::uri::UrlExt;
414-
let mut url = self.endpoint.clone();
414+
let base_url = self.endpoint.clone();
415415

416416
// TODO unify with receiver's fn subdir_path_from_pubkey
417417
let hash = sha256::Hash::hash(&self.hpke_ctx.reply_pair.public_key().to_compressed_bytes());
418418
let subdir: ShortId = hash.into();
419-
url.set_path(&subdir.to_string());
419+
let url = base_url.join(&subdir.to_string()).map_err(InternalCreateRequestError::Url)?;
420420
let body = encrypt_message_a(
421421
Vec::new(),
422422
&self.hpke_ctx.reply_pair.public_key().clone(),

0 commit comments

Comments
 (0)