From 8de7c629e2ff1e8fe105e956985422cfc127829a Mon Sep 17 00:00:00 2001 From: bixiaoyan Date: Thu, 23 Nov 2023 15:34:52 +0800 Subject: [PATCH] Fix serving static files --- fix-serving-static-files.patch | 33 +++++++++++++++++++++++++++++++++ pcs.spec | 6 +++++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 fix-serving-static-files.patch diff --git a/fix-serving-static-files.patch b/fix-serving-static-files.patch new file mode 100644 index 0000000..72dcf27 --- /dev/null +++ b/fix-serving-static-files.patch @@ -0,0 +1,33 @@ +From 272009b4e3582f9b7a045c3f4ee867f9e943ee9e Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Mon, 27 Nov 2023 09:34:46 +0800 +Subject: [PATCH] fix serving static files + +--- + pcs/daemon/app/ui.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/pcs/daemon/app/ui.py b/pcs/daemon/app/ui.py +index cad6824..11440a0 100644 +--- a/pcs/daemon/app/ui.py ++++ b/pcs/daemon/app/ui.py +@@ -67,14 +67,14 @@ class Logout(app_session.Mixin, AjaxMixin, BaseHandler): + + class StaticFileMayBe(StaticFile): + # pylint: disable=abstract-method +- def get(self, *args, **kwargs): ++ async def get(self, *args, **kwargs): + # pylint: disable=signature-differs + # pylint: disable=invalid-overridden-method + if not os.path.isdir(str(self.root)): + # spa is probably not installed + self.set_status(404, "Not Found") + return None +- return super().get(*args, **kwargs) ++ return await super().get(*args, **kwargs) + + + def get_routes( +-- +2.33.0 + diff --git a/pcs.spec b/pcs.spec index 548f392..de666ea 100644 --- a/pcs.spec +++ b/pcs.spec @@ -1,6 +1,6 @@ Name: pcs Version: 0.11.2 -Release: 9 +Release: 10 License: GPLv2 and BSD-2-Clause and ASL 2.0 and MIT URL: https://github.com/ClusterLabs/pcs Summary: Pacemaker Configuration System @@ -49,6 +49,7 @@ Patch8: tests-fix-datetime-race-condition.patch Patch9: Fix-CVE-2022-1049.patch Patch10: Fix-CVE-2022-2735.patch Patch11: improve-error-messages-in-pcs-resource-move.patch +Patch12: fix-serving-static-files.patch # git for patches BuildRequires: git-core BuildRequires: make @@ -411,6 +412,9 @@ run_all_tests %license pyagentx_LICENSE.txt %changelog +* Thu Nov 23 2023 bixiaoyan - 0.11.2-10 +- Fix serving static files + * Wed Oct 25 2023 zouzhimin - 0.11.2-9 - improve error messages in pcs resource move