changeset 4227:b459b036f263

Changed some setHttpHeader-calls to new header API
author Florian Krupicka <florian.krupicka@googlemail.com>
date Fri, 18 Jul 2008 01:28:31 +0200
parents b2df0c84140f
children d9b3c6585585
files MoinMoin/wsgiapp.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/wsgiapp.py	Wed Jul 16 17:23:21 2008 +0200
+++ b/MoinMoin/wsgiapp.py	Fri Jul 18 01:28:31 2008 +0200
@@ -6,6 +6,7 @@
                 2008-2008 MoinMoin:FlorianKrupicka
     @license: GNU GPL, see COPYING for details.
 """
+from werkzeug.http import HeaderSet
 from werkzeug.utils import responder
 from werkzeug.wrappers import Response
 from werkzeug.exceptions import NotFound
@@ -109,10 +110,10 @@
         # * cookie (even if we aren't sending one now)
         # * User-Agent (because a bot might be denied and get no content)
         # * Accept-Language (except if moin is told to ignore browser language)
-        if request.cfg.language_ignore_browser:
-            request.setHttpHeader("Vary: Cookie,User-Agent")
-        else:
-            request.setHttpHeader("Vary: Cookie,User-Agent,Accept-Language")
+        hs = HeaderSet(('Cookie', 'User-Agent'))
+        if not request.cfg.language_ignore_browser:
+            hs.add('Accept-Language')
+        request.headers.add('Vary', str(hs))
 
         # Handle request. We have these options:
         # 1. jump to page where user left off