diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 7d1a951b..0ff9c0ef 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -5659,15 +5659,15 @@ class HttpCli(object): raise Pebkac(500, "sqlite3 not found on server; sharing is disabled") raise Pebkac(500, "server busy, cannot create share; please retry in a bit") + skey = self.uparam.get("skey") or self.vpath.split("/")[-1] + if self.args.shr_v: - self.log("handle_eshare: " + self.req) + self.log("handle_eshare: " + skey) cur = idx.get_shr() if not cur: raise Pebkac(400, "huh, sharing must be disabled in the server config...") - skey = self.vpath.split("/")[-1] - rows = cur.execute("select un, t1 from sh where k = ?", (skey,)).fetchall() un = rows[0][0] if rows and rows[0] else "" diff --git a/copyparty/web/shares.js b/copyparty/web/shares.js index 86d4cc45..e3faf029 100644 --- a/copyparty/web/shares.js +++ b/copyparty/web/shares.js @@ -1,9 +1,11 @@ +var SRS = SR.trimEnd('/') + '/'; + var t = QSA('a[k]'); for (var a = 0; a < t.length; a++) t[a].onclick = rm; function rm() { - var u = SR + shr + uricom_enc(this.getAttribute('k')) + '?eshare=rm', + var u = SRS + '?eshare=rm&skey=' + uricom_enc(this.getAttribute('k')), xhr = new XHR(); xhr.open('POST', u, true); @@ -13,7 +15,7 @@ function rm() { function bump() { var k = this.closest('tr').getElementsByTagName('a')[2].getAttribute('k'), - u = SR + shr + uricom_enc(k) + '?eshare=' + this.value, + u = SRS + '?skey=' + uricom_enc(k) + '&eshare=' + this.value, xhr = new XHR(); xhr.open('POST', u, true);