From 3baa93048be6066281e5d0cdf254d1857b2ab834 Mon Sep 17 00:00:00 2001 From: catborise Date: Thu, 5 Nov 2026 12:12:21 +0300 Subject: [PATCH] chore(deps): a list's search is kept in sessionStorage, without js-cookie js-cookie served only table_filter.js, which kept a list's search in a cookie for a day; the cookie went to the server with every request. The search is now kept in the tab's sessionStorage: it stays across reloads and pages in that tab, a new tab starts empty, and the server never sees it. The library goes. --- instances/tests/test_xss.py | 2 +- static/js/js.cookie.js | 2 -- static/js/table_filter.js | 25 +++++++++++++++++++++---- templates/base.html | 2 -- 4 files changed, 22 insertions(+), 9 deletions(-) delete mode 100644 static/js/js.cookie.js diff --git a/instances/tests/test_xss.py b/instances/tests/test_xss.py index 459d8e0d..a3061bb7 100644 --- a/instances/tests/test_xss.py +++ b/instances/tests/test_xss.py @@ -134,7 +134,7 @@ class TemplateHtmlConcatenationTestCase(TestCase): # has to be reviewed (use .text() / .val() / DOM APIs for server data instead). HTML_SINK = re.compile(r"""\.html\(|innerHTML\s*=|append\(\s*['"]<""") # the libraries kept as published, not the app's scripts -VENDORED_SCRIPTS = {"jquery.js", "js.cookie.js", "socket.io.js"} +VENDORED_SCRIPTS = {"jquery.js", "socket.io.js"} ALLOWED_HTML_SINKS = { ("static/js/instance_page.js", "hostDevices.innerHTML = html;"): "the panel's own fragment, host_devices_form.html, escaped by Django", ("static/js/instance_page.js", "migratePlan.innerHTML = html;"): "the panel's own fragment, migrate_plan.html, escaped by Django", diff --git a/static/js/js.cookie.js b/static/js/js.cookie.js deleted file mode 100644 index a5d37e23..00000000 --- a/static/js/js.cookie.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! js-cookie v3.0.8 | MIT */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self,function(){var n=e.Cookies,o=e.Cookies=t();o.noConflict=function(){return e.Cookies=n,o}}())}(this,(function(){"use strict";function e(e){for(var t=1;t - -