changeset 1073:a6bb4df3888d

fix http headers bug
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 30 Jul 2006 02:03:28 +0200
parents c1f5ee67a02b
children a60c236bf0ac 0a3a7ca70e48
files MoinMoin/request/__init__.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/request/__init__.py	Thu Jul 27 21:24:28 2006 +0200
+++ b/MoinMoin/request/__init__.py	Sun Jul 30 02:03:28 2006 +0200
@@ -1135,22 +1135,23 @@
 
             @param more_headers: list of additional header strings
         """
-        headers = more_headers + getattr(self, 'user_headers', [])
+        user_headers = getattr(self, 'user_headers', [])
         self.user_headers = []
+        all_headers = more_headers + user_headers
 
         # Send headers only once
         sent_headers = getattr(self, 'sent_headers', 0)
         self.sent_headers = sent_headers + 1
         if sent_headers:
-            raise error.InternalError("emit_http_headers called multiple times(%d)! Headers: %r" % (sent_headers, headers))
+            raise error.InternalError("emit_http_headers called multiple times(%d)! Headers: %r" % (sent_headers, all_headers))
         #else:
-        #    self.log("Notice: emit_http_headers called first time. Headers: %r" % headers)
+        #    self.log("Notice: emit_http_headers called first time. Headers: %r" % all_headers)
 
         content_type = None
         status = None
         headers = []
         # assemble complete list of http headers
-        for header in headers:
+        for header in all_headers:
             if isinstance(header, unicode):
                 header = header.encode('ascii')
             key, value = header.split(':', 1)