From a7e2a0c981f551f522ad112acc40b728fca12714 Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 18 Oct 2024 19:04:22 +0000 Subject: [PATCH] up2k: fix chinese-specific js crash; closes #108 the client-side ETA, included as metadata in POSTs, would crash the js with the initial "Starting..." text --- copyparty/web/up2k.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index a8eb1635..95b929ff 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -2759,7 +2759,8 @@ function up2k_init(subtle) { xhr.setRequestHeader("X-Up2k-Stat", "{0}/{1}/{2}/{3} {4}/{5} {6}".format( pvis.ctr.ok, pvis.ctr.ng, pvis.ctr.bz, pvis.ctr.q, btot, btot - bfin, - st.eta.t.split(' ').pop())); + st.eta.t.indexOf('/s, ')+1 ? st.eta.t.split(' ').pop() : 'x')); + xhr.setRequestHeader('Content-Type', 'application/octet-stream'); if (xhr.overrideMimeType) xhr.overrideMimeType('Content-Type', 'application/octet-stream');