summaryrefslogtreecommitdiffstats
path: root/ipsilon/util
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2014-10-06 22:18:56 -0400
committerPatrick Uiterwijk <puiterwijk@redhat.com>2014-10-07 16:48:27 +0200
commit049e2dfb2edf97d32f66fa97ee04bc8ccad44df8 (patch)
tree913ea11fbc3b42d925956ae33751836f4b828c8a /ipsilon/util
parent907d40cac424c9c7bf3a190b445858bc6eab949e (diff)
downloadipsilon-049e2dfb2edf97d32f66fa97ee04bc8ccad44df8.tar.gz
ipsilon-049e2dfb2edf97d32f66fa97ee04bc8ccad44df8.tar.xz
ipsilon-049e2dfb2edf97d32f66fa97ee04bc8ccad44df8.zip
Add way to set default headers
When a Page is called automatically sets default headers by adding headers on the default_headers variable. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Diffstat (limited to 'ipsilon/util')
-rwxr-xr-xipsilon/util/page.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/ipsilon/util/page.py b/ipsilon/util/page.py
index a99d2f4..1815ceb 100755
--- a/ipsilon/util/page.py
+++ b/ipsilon/util/page.py
@@ -52,6 +52,7 @@ class Page(Log):
self.basepath = cherrypy.config.get('base.mount', "")
self.user = None
self._is_form_page = form
+ self.default_headers = dict()
def _compare_urls(self, url1, url2):
u1 = unquote(url1)
@@ -62,6 +63,8 @@ class Page(Log):
def __call__(self, *args, **kwargs):
# pylint: disable=star-args
+ cherrypy.response.headers.update(self.default_headers)
+
self.user = UserSession().get_user()
if len(args) > 0: