From 0f9877201b3c13413d966a009a63f61553e0d01f Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 3 Sep 2023 19:50:31 +0000 Subject: [PATCH] support cache directives in --css-browser, --js-browser; for example --css-browser=/the.css?cache=600 (seconds) or --js-browser=/.res/the.js?cache=i (7 days) --- copyparty/httpcli.py | 8 ++++++-- copyparty/web/browser.html | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 2af7fa30..85b33d04 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -3800,10 +3800,14 @@ class HttpCli(object): } if self.args.js_browser: - j2a["js"] = self.args.js_browser + zs = self.args.js_browser + zs += "&" if "?" in zs else "?" + j2a["js"] = zs if self.args.css_browser: - j2a["css"] = self.args.css_browser + zs = self.args.css_browser + zs += "&" if "?" in zs else "?" + j2a["css"] = zs if not self.conn.hsrv.prism: j2a["no_prism"] = True diff --git a/copyparty/web/browser.html b/copyparty/web/browser.html index 35782b9d..77324346 100644 --- a/copyparty/web/browser.html +++ b/copyparty/web/browser.html @@ -11,7 +11,7 @@ {%- if css %} - + {%- endif %} @@ -173,7 +173,7 @@ {%- if js %} - + {%- endif %}