summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--store.py8
-rw-r--r--webui.py2
2 files changed, 7 insertions, 3 deletions
diff --git a/store.py b/store.py
index 8d0c79e..7e6502a 100644
--- a/store.py
+++ b/store.py
@@ -2310,8 +2310,12 @@ class Store:
def _invalidate_cache(self):
if self.config.fastly_api_key:
# Build up a list of tags we want to purge
- tags = ["pkg~%s" % pkg if pkg is not None else "simple-index"
- for pkg in self._changed_packages]
+ tags = []
+ for pkg in self._changed_packages:
+ if pkg is None:
+ tags += ["simple-index"]
+ else:
+ tags += [safe_name(pkg).lower()]
# We only need to bother to enqueue a task if we have something
# to purge
diff --git a/webui.py b/webui.py
index 0d17ceb..038db24 100644
--- a/webui.py
+++ b/webui.py
@@ -847,7 +847,7 @@ class WebUI:
self.handler.send_header("X-PYPI-LAST-SERIAL", str(serial))
self.handler.send_header(
- "Surrogate-Key", "package pkg~%s" % package)
+ "Surrogate-Key", "package pkg~%s" % safe_name(package).lower())
# we expect nginx to have configured a location named
# '/packages_raw/...' that aliases the original path correctly, see