mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
fix some vproxy issues (#93):
* navpane would always feed the vproxy paths into the tree instead of only when necessary (the initial load) * mkdir would return `X-New-Dir` without the `rp-loc` prefix * chpw and some other redirects also sent raw vpaths Reported-by: @iridial
This commit is contained in:
parent
5153db6bff
commit
0b46b1a614
|
@ -968,10 +968,10 @@ class HttpCli(object):
|
||||||
status: int = 200,
|
status: int = 200,
|
||||||
use302: bool = False,
|
use302: bool = False,
|
||||||
) -> bool:
|
) -> bool:
|
||||||
vp = self.args.RS + vpath
|
vp = self.args.SRS + vpath
|
||||||
html = self.j2s(
|
html = self.j2s(
|
||||||
"msg",
|
"msg",
|
||||||
h2='<a href="/{}">{} /{}</a>'.format(
|
h2='<a href="%s">%s %s</a>' % (
|
||||||
quotep(vp) + suf, flavor, html_escape(vp, crlf=True) + suf
|
quotep(vp) + suf, flavor, html_escape(vp, crlf=True) + suf
|
||||||
),
|
),
|
||||||
pre=msg,
|
pre=msg,
|
||||||
|
@ -979,7 +979,7 @@ class HttpCli(object):
|
||||||
).encode("utf-8", "replace")
|
).encode("utf-8", "replace")
|
||||||
|
|
||||||
if use302:
|
if use302:
|
||||||
self.reply(html, status=302, headers={"Location": "/" + vpath})
|
self.reply(html, status=302, headers={"Location": vp})
|
||||||
else:
|
else:
|
||||||
self.reply(html, status=status)
|
self.reply(html, status=status)
|
||||||
|
|
||||||
|
@ -2407,7 +2407,7 @@ class HttpCli(object):
|
||||||
if ok:
|
if ok:
|
||||||
msg = "new password OK"
|
msg = "new password OK"
|
||||||
|
|
||||||
redir = "/?h" if ok else ""
|
redir = (self.args.SRS + "?h") if ok else ""
|
||||||
html = self.j2s("msg", h1=msg, h2='<a href="/?h">ack</a>', redir=redir)
|
html = self.j2s("msg", h1=msg, h2='<a href="/?h">ack</a>', redir=redir)
|
||||||
self.reply(html.encode("utf-8"))
|
self.reply(html.encode("utf-8"))
|
||||||
return True
|
return True
|
||||||
|
@ -2512,7 +2512,7 @@ class HttpCli(object):
|
||||||
except:
|
except:
|
||||||
raise Pebkac(500, min_ex())
|
raise Pebkac(500, min_ex())
|
||||||
|
|
||||||
self.out_headers["X-New-Dir"] = quotep(vpath)
|
self.out_headers["X-New-Dir"] = quotep(self.args.RS + vpath)
|
||||||
|
|
||||||
if dav:
|
if dav:
|
||||||
self.reply(b"", 201)
|
self.reply(b"", 201)
|
||||||
|
@ -4102,7 +4102,9 @@ class HttpCli(object):
|
||||||
dst = dst[len(top) + 1 :]
|
dst = dst[len(top) + 1 :]
|
||||||
|
|
||||||
ret = self.gen_tree(top, dst, self.uparam.get("k", ""))
|
ret = self.gen_tree(top, dst, self.uparam.get("k", ""))
|
||||||
if self.is_vproxied:
|
if self.is_vproxied and not self.uparam["tree"]:
|
||||||
|
# uparam is '' on initial load, which is
|
||||||
|
# the only time we gotta fill in the blanks
|
||||||
parents = self.args.R.split("/")
|
parents = self.args.R.split("/")
|
||||||
for parent in reversed(parents):
|
for parent in reversed(parents):
|
||||||
ret = {"k%s" % (parent,): ret, "a": []}
|
ret = {"k%s" % (parent,): ret, "a": []}
|
||||||
|
|
|
@ -170,6 +170,7 @@ class Cfg(Namespace):
|
||||||
s_wr_sz=256 * 1024,
|
s_wr_sz=256 * 1024,
|
||||||
sort="href",
|
sort="href",
|
||||||
srch_hits=99999,
|
srch_hits=99999,
|
||||||
|
SRS="/",
|
||||||
th_covers=["folder.png"],
|
th_covers=["folder.png"],
|
||||||
th_coversd=["folder.png"],
|
th_coversd=["folder.png"],
|
||||||
th_covers_set=set(["folder.png"]),
|
th_covers_set=set(["folder.png"]),
|
||||||
|
|
Loading…
Reference in a new issue