Commits

Donald Stufft committed a485b9f

Use a consistent naming scheme

  • Participants
  • Parent commits a6eadea

Comments (0)

Files changed (2)

     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
                 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