Mercurial > moin > 1.9
changeset 942:86ea8f868030
use only one setHttpHeader call for one header type, add warning to docstring in base class
author | Thomas Waldmann <tw AT waldmann-edv DOT de> |
---|---|
date | Sun, 16 Jul 2006 15:12:06 +0200 |
parents | 16f7b6728b4e |
children | 274b021f26b1 |
files | MoinMoin/request/__init__.py |
diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/MoinMoin/request/__init__.py Sun Jul 16 14:58:21 2006 +0200 +++ b/MoinMoin/request/__init__.py Sun Jul 16 15:12:06 2006 +0200 @@ -1133,7 +1133,11 @@ self.http_headers(["Status: 302 Found", "Location: %s" % url]) def setHttpHeader(self, header): - """ Save header for later send. """ + """ Save header for later send. + + Attention: although we use a list here, some implementations use a dict, + thus multiple calls with the same header type do NOT work in the end! + """ self.user_headers.append(header) def setResponseCode(self, code, message=None): @@ -1231,9 +1235,7 @@ # Set Cache control header for http 1.1 caches # See http://www.cse.ohio-state.edu/cgi-bin/rfc/rfc2109.html#sec-4.2.3 # and http://www.cse.ohio-state.edu/cgi-bin/rfc/rfc2068.html#sec-14.9 - self.setHttpHeader('Cache-Control: no-cache="set-cookie"') - self.setHttpHeader('Cache-Control: private') - self.setHttpHeader('Cache-Control: max-age=0') + self.setHttpHeader('Cache-Control: no-cache="set-cookie", private, max-age=0') # Set Expires for http 1.0 caches (does not support Cache-Control) yearago = time.time() - (3600 * 24 * 365)