diff src/server/server.py @ 950:67a59552f3e3

server (blog): fixed avatars handling, there is now a well-known URL to SERVICE_PROFILE cache
author Goffi <goffi@goffi.org>
date Sat, 03 Jun 2017 22:27:04 +0200
parents 00236973e138
children 4f7cb6335a33
line wrap: on
line diff
--- a/src/server/server.py	Tue May 23 00:06:03 2017 +0200
+++ b/src/server/server.py	Sat Jun 03 22:27:04 2017 +0200
@@ -2128,6 +2128,12 @@
         @raise IOError: the certificate file doesn't exist
         @raise OpenSSL.crypto.Error: the certificate file is invalid
         """
+        # now that we have service profile connected, we add resource for its cache
+        service_path = regex.pathEscape(C.SERVICE_PROFILE)
+        cache_dir = os.path.join(self.cache_root_dir, service_path)
+        self.cache_resource.putChild(service_path, ProtectedFile(cache_dir))
+        self.service_cache_url = os.path.join(C.CACHE_DIR, service_path)
+
         if self.options['connection_type'] in ('https', 'both'):
             self._TLSOptionsCheck()
             context_factory = self._getTLSContextFactory()