summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Stufft <donald@stufft.io>2013-07-25 16:45:17 -0400
committerDonald Stufft <donald@stufft.io>2013-07-25 16:45:17 -0400
commitc0ae35729aeae74159ebdb32b87e5c1c3091afed (patch)
treeaeae662c3836c2c9370176efe882732eb29923af
parent15bb8d9b618a8f21349a55cf56e94876ee657f5c (diff)
downloaddecorator-c0ae35729aeae74159ebdb32b87e5c1c3091afed.tar.gz
Use a consistent naming scheme
-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