summaryrefslogtreecommitdiff
path: root/paste/wsgiwrappers.py
diff options
context:
space:
mode:
authorbbangert <devnull@localhost>2007-06-28 18:17:23 +0000
committerbbangert <devnull@localhost>2007-06-28 18:17:23 +0000
commit2739d6d420bc3488776906fb8b7b207feae3c3ac (patch)
tree795ff2c2ed93c47cbf054f9589c399024264f7d5 /paste/wsgiwrappers.py
parented38317a8b30c7a5c340a98957105d5cb36cc1a8 (diff)
downloadpaste-2739d6d420bc3488776906fb8b7b207feae3c3ac.tar.gz
Fix bug in last commit, apply header defaults to WSGIResponse and default cache-control to no-cache.
Diffstat (limited to 'paste/wsgiwrappers.py')
-rw-r--r--paste/wsgiwrappers.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/paste/wsgiwrappers.py b/paste/wsgiwrappers.py
index e27fd18..334a5c2 100644
--- a/paste/wsgiwrappers.py
+++ b/paste/wsgiwrappers.py
@@ -107,9 +107,6 @@ class WSGIRequest(object):
# This isn't "state" really, since the object is derivative:
self.headers = EnvironHeaders(environ)
- # Default caching of requests using Response to not cache
- self.headers['Cache-Control'] = 'no-cache'
-
defaults = self.defaults._current_obj()
self.charset = defaults.get('charset')
if self.charset:
@@ -297,8 +294,8 @@ class WSGIResponse(object):
"""
defaults = StackedObjectProxy(
- default=dict(content_type='text/html',
- charset='utf-8', errors='strict')
+ default=dict(content_type='text/html', charset='utf-8',
+ errors='strict', headers={'Cache-Control':'no-cache'})
)
def __init__(self, content='', mimetype=None, code=200):
self._iter = None
@@ -315,6 +312,7 @@ class WSGIResponse(object):
charset = defaults.get('charset')
if charset:
mimetype = '%s; charset=%s' % (mimetype, charset)
+ self.headers.update(defaults.get('headers', {}))
self.headers['Content-Type'] = mimetype
self.errors = defaults.get('errors', 'strict')