From 8a09601be8be0c614e3620ff98e0f8b1052565e9 Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 16 Mar 2023 20:52:43 +0000 Subject: [PATCH] url-param ?v disables index.html --- copyparty/httpcli.py | 6 +++++- copyparty/web/browser.js | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 8ef03c32..76c56856 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -3570,7 +3570,11 @@ class HttpCli(object): files.append(item) item["rd"] = rem - if self.cookies.get("idxh") == "y": + if ( + self.cookies.get("idxh") == "y" + and "ls" not in self.uparam + and "v" not in self.uparam + ): idx_html = set(["index.htm", "index.html"]) for item in files: if item["name"] in idx_html: diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 6c26a68c..746d56fb 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -1281,6 +1281,7 @@ function set_files_html(html) { var ACtx = window.AudioContext || window.webkitAudioContext, + noih = /[?&]v\b/.exec('' + location), hash0 = location.hash, mp; @@ -5503,7 +5504,7 @@ var treectl = (function () { } r.chk_index_html = function (top, res) { - if (!r.idxh || !res || !res.files) + if (!r.idxh || !res || !res.files || noih) return; for (var a = 0; a < res.files.length; a++)