Set Cache-control on all generated pages, centralize in Endpoint
authorRob Crittenden <rcritten@redhat.com>
Mon, 16 Mar 2015 20:31:55 +0000 (16:31 -0400)
committerRob Crittenden <rcritten@redhat.com>
Thu, 19 Mar 2015 20:57:55 +0000 (16:57 -0400)
See "Bindings for the OASIS Security Assertion Markup Language (SAML)
V2.0" section 3.2.3.2.

https://fedorahosted.org/ipsilon/ticket/7

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Nathan Kinder <nkinder@redhat.com>
ipsilon/admin/common.py
ipsilon/providers/openid/meta.py
ipsilon/rest/common.py
ipsilon/util/endpoint.py
ipsilon/util/page.py

index fd20077..b371fe9 100644 (file)
@@ -39,11 +39,6 @@ class AdminPage(Page):
 
     def __init__(self, *args, **kwargs):
         super(AdminPage, self).__init__(*args, **kwargs)
-        self.default_headers.update({
-            'Cache-Control': 'no-cache, must-revalidate',
-            'Pragma': 'no-cache',
-            'Expires': 'Thu, 01 Dec 1994 16:00:00 GMT',
-        })
         self.auth_protect = True
 
 
index 440ef1e..6e66120 100644 (file)
@@ -9,11 +9,6 @@ class MetaHandler(ProviderPageBase):
 
     def __init__(self, *args, **kwargs):
         super(MetaHandler, self).__init__(*args, **kwargs)
-        self.default_headers.update({
-            'Cache-Control': 'no-cache, must-revalidate',
-            'Pragma': 'no-cache',
-            'Expires': 'Thu, 01 Dec 1994 16:00:00 GMT',
-        })
         self._template_name = None
         self._take_args = False
 
index 4103e8e..7baea94 100644 (file)
@@ -36,11 +36,6 @@ class RestPage(Endpoint):
 
     def __init__(self, *args, **kwargs):
         super(RestPage, self).__init__(*args, **kwargs)
-        self.default_headers.update({
-            'Cache-Control': 'no-cache, must-revalidate',
-            'Pragma': 'no-cache',
-            'Expires': 'Thu, 01 Dec 1994 16:00:00 GMT',
-        })
         self.auth_protect = True
 
 
index f6fd667..f160329 100644 (file)
@@ -16,7 +16,10 @@ class Endpoint(Log):
         self._site = site
         self.basepath = cherrypy.config.get('base.mount', "")
         self.user = None
-        self.default_headers = dict()
+        self.default_headers = {
+            'Cache-Control': 'no-cache, no-store, must-revalidate, private',
+            'Pragma': 'no-cache',
+        }
         self.auth_protect = False
 
     def get_url(self):
index 7e88534..21c9e3e 100644 (file)
@@ -49,7 +49,6 @@ class Page(Endpoint):
         self.basepath = cherrypy.config.get('base.mount', "")
         self.user = None
         self._is_form_page = form
-        self.default_headers = dict()
         self.auth_protect = False
 
     def get_url(self):