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`
This commit is contained in:
Сашка724ая 2026-03-07 10:21:19 +11:00 committed by GitHub
parent 1c0b5d26ea
commit 31b23843f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2762,8 +2762,9 @@ class HttpCli(object):
vpath = quotep(vpath) vpath = quotep(vpath)
if self.args.up_site: if self.args.up_site:
url = "%s%s%s" % ( url = "%s%s%s%s" % (
self.args.up_site, self.args.up_site,
self.args.RS,
vpath, vpath,
vsuf, vsuf,
) )
@ -3048,7 +3049,7 @@ class HttpCli(object):
raise Pebkac(500, t % zt) raise Pebkac(500, t % zt)
ret["purl"] = vp_req + ret["purl"][len(vp_vfs) :] 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: if "purl" in ret:
ret["purl"] = self.args.SR + ret["purl"] ret["purl"] = self.args.SR + ret["purl"]
@ -3957,7 +3958,7 @@ class HttpCli(object):
vpath = vjoin(upload_vpath, lfn) vpath = vjoin(upload_vpath, lfn)
if self.args.up_site: 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] rel_url = "/" + j_url.split("//", 1)[-1].split("/", 1)[-1]
else: else:
ah_url = rel_url = "/%s%s%s" % (self.args.RS, quotep(vpath), vsuf) 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: if self.args.shr_site:
site = self.args.shr_site[:-1] site = self.args.shr_site[:-1]
elif self.is_vproxied:
site = self.args.SR
else: else:
site = "" site = ""
if self.is_vproxied:
site += self.args.SR
html = self.j2s( html = self.j2s(
"shares", "shares",
@ -6459,9 +6460,10 @@ class HttpCli(object):
# NOTE: several clients (frontend, party-up) expect url at response[15:] # NOTE: several clients (frontend, party-up) expect url at response[15:]
if self.args.shr_site: if self.args.shr_site:
surl = "created share: %s%s%s/%s" % ( surl = "created share: %s%s%s%s/%s" % (
self.args.shr_site, self.args.shr_site[:-1],
self.args.shr[1:], self.args.SR,
self.args.shr,
skey, skey,
fn, fn,
) )