From 31b23843f2d51049da00c821f2418d0c44389cd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B0=D1=88=D0=BA=D0=B0724=D0=B0=D1=8F?= Date: Sat, 7 Mar 2026 10:21:19 +1100 Subject: [PATCH] `rp-loc` and `site` now combines better (#1323); `--site` / `--up-site` / `--shr-site` now only specifies the domain/origin, discarding the path (if any), keeping `rp-loc` --- copyparty/httpcli.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 472c270c..10c72381 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -2762,8 +2762,9 @@ class HttpCli(object): vpath = quotep(vpath) if self.args.up_site: - url = "%s%s%s" % ( + url = "%s%s%s%s" % ( self.args.up_site, + self.args.RS, vpath, vsuf, ) @@ -3048,7 +3049,7 @@ class HttpCli(object): raise Pebkac(500, t % zt) ret["purl"] = vp_req + ret["purl"][len(vp_vfs) :] - if self.is_vproxied and not self.args.up_site: + if self.is_vproxied: if "purl" in ret: ret["purl"] = self.args.SR + ret["purl"] @@ -3957,7 +3958,7 @@ class HttpCli(object): vpath = vjoin(upload_vpath, lfn) if self.args.up_site: - ah_url = j_url = self.args.up_site + quotep(vpath) + vsuf + ah_url = j_url = self.args.up_site + self.args.RS + quotep(vpath) + vsuf rel_url = "/" + j_url.split("//", 1)[-1].split("/", 1)[-1] else: ah_url = rel_url = "/%s%s%s" % (self.args.RS, quotep(vpath), vsuf) @@ -6290,10 +6291,10 @@ class HttpCli(object): if self.args.shr_site: site = self.args.shr_site[:-1] - elif self.is_vproxied: - site = self.args.SR else: site = "" + if self.is_vproxied: + site += self.args.SR html = self.j2s( "shares", @@ -6459,9 +6460,10 @@ class HttpCli(object): # NOTE: several clients (frontend, party-up) expect url at response[15:] if self.args.shr_site: - surl = "created share: %s%s%s/%s" % ( - self.args.shr_site, - self.args.shr[1:], + surl = "created share: %s%s%s%s/%s" % ( + self.args.shr_site[:-1], + self.args.SR, + self.args.shr, skey, fn, )