From cf12d32c6f979a997515aa7e87dd8ad528a94e15 Mon Sep 17 00:00:00 2001 From: Matthias Dellweg Date: Wed, 20 May 2026 15:53:20 +0200 Subject: [PATCH] Sanitize the api-cache path --- CHANGES/pulp-glue/+cache_file.bugfix | 1 + pulp-glue/src/pulp_glue/common/openapi.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 CHANGES/pulp-glue/+cache_file.bugfix diff --git a/CHANGES/pulp-glue/+cache_file.bugfix b/CHANGES/pulp-glue/+cache_file.bugfix new file mode 100644 index 000000000..695bdeefc --- /dev/null +++ b/CHANGES/pulp-glue/+cache_file.bugfix @@ -0,0 +1 @@ +Sanitize the filename of the chached `api.json`. diff --git a/pulp-glue/src/pulp_glue/common/openapi.py b/pulp-glue/src/pulp_glue/common/openapi.py index 53aafe538..8b5074654 100644 --- a/pulp-glue/src/pulp_glue/common/openapi.py +++ b/pulp-glue/src/pulp_glue/common/openapi.py @@ -216,8 +216,10 @@ def load_api(self, refresh_cache: bool = False) -> None: apidoc_cache: str = os.path.join( os.path.expanduser(xdg_cache_home), "squeezer", - (self._base_url + "_" + self._doc_path).replace(":", "_").replace("/", "_") - + "api.json", + (self._base_url + "_" + self._doc_path) + .replace(":", "_") + .replace("/", "_") + .replace("?", "_"), ) try: if refresh_cache: