mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
fix up2k.js encoding root as //
This commit is contained in:
parent
a3df1f538b
commit
0c01156027
|
@ -256,7 +256,7 @@ class HttpCli(object):
|
||||||
raise Pebkac(400, "folders verboten")
|
raise Pebkac(400, "folders verboten")
|
||||||
|
|
||||||
# up2k-php compat
|
# up2k-php compat
|
||||||
for k in "/chunkpit.php", "/handshake.php":
|
for k in "chunkpit.php", "handshake.php":
|
||||||
if self.vpath.endswith(k):
|
if self.vpath.endswith(k):
|
||||||
self.vpath = self.vpath[: -len(k)]
|
self.vpath = self.vpath[: -len(k)]
|
||||||
|
|
||||||
|
|
|
@ -95,12 +95,14 @@ function up2k_init(have_crypto) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var post_url = o('bup').getElementsByTagName('form')[0].getAttribute('action');
|
var post_url = o('bup').getElementsByTagName('form')[0].getAttribute('action');
|
||||||
|
if (post_url && post_url.charAt(post_url.length - 1) !== '/')
|
||||||
|
post_url += '/';
|
||||||
|
|
||||||
var shame = 'your browser <a href="https://www.chromium.org/blink/webcrypto">disables sha512</a> unless you <a href="' + (window.location + '').replace(':', 's:') + '">use https</a>'
|
var shame = 'your browser <a href="https://www.chromium.org/blink/webcrypto">disables sha512</a> unless you <a href="' + (window.location + '').replace(':', 's:') + '">use https</a>'
|
||||||
var is_https = (window.location + '').indexOf('https:') === 0;
|
var is_https = (window.location + '').indexOf('https:') === 0;
|
||||||
if (is_https)
|
if (is_https)
|
||||||
// chrome<37 firefox<34 edge<12 ie<11 opera<24 safari<10.1
|
// chrome<37 firefox<34 edge<12 ie<11 opera<24 safari<10.1
|
||||||
shame = 'your browser is impressively ancient'
|
shame = 'your browser is impressively ancient';
|
||||||
|
|
||||||
// upload ui hidden by default, clicking the header shows it
|
// upload ui hidden by default, clicking the header shows it
|
||||||
o('u2tgl').onclick = function (e) {
|
o('u2tgl').onclick = function (e) {
|
||||||
|
@ -675,7 +677,7 @@ function up2k_init(have_crypto) {
|
||||||
(xhr.responseText && xhr.responseText) ||
|
(xhr.responseText && xhr.responseText) ||
|
||||||
"no further information"));
|
"no further information"));
|
||||||
};
|
};
|
||||||
xhr.open('POST', post_url + '/handshake.php', true);
|
xhr.open('POST', post_url + 'handshake.php', true);
|
||||||
xhr.responseType = 'text';
|
xhr.responseType = 'text';
|
||||||
xhr.send(JSON.stringify({
|
xhr.send(JSON.stringify({
|
||||||
"name": t.name,
|
"name": t.name,
|
||||||
|
@ -735,7 +737,7 @@ function up2k_init(have_crypto) {
|
||||||
(xhr.responseText && xhr.responseText) ||
|
(xhr.responseText && xhr.responseText) ||
|
||||||
"no further information"));
|
"no further information"));
|
||||||
};
|
};
|
||||||
xhr.open('POST', post_url + '/chunkpit.php', true);
|
xhr.open('POST', post_url + 'chunkpit.php', true);
|
||||||
//xhr.setRequestHeader("X-Up2k-Hash", t.hash[npart].substr(1) + "x");
|
//xhr.setRequestHeader("X-Up2k-Hash", t.hash[npart].substr(1) + "x");
|
||||||
xhr.setRequestHeader("X-Up2k-Hash", t.hash[npart]);
|
xhr.setRequestHeader("X-Up2k-Hash", t.hash[npart]);
|
||||||
xhr.setRequestHeader("X-Up2k-Wark", t.wark);
|
xhr.setRequestHeader("X-Up2k-Wark", t.wark);
|
||||||
|
|
Loading…
Reference in a new issue