diff roundup/cgi/client.py @ 6544:9aa8df0b4426

issue2551178 - fix Traceback in Apache WSGI Alternate way to fix issue I hope. We do want to delete the headers, not just emit them with no value.
author John Rouillard <rouilj@ieee.org>
date Tue, 07 Dec 2021 11:15:04 -0500
parents f8df7fed18f6
children c58c7cd31243
line wrap: on
line diff
--- a/roundup/cgi/client.py	Tue Dec 07 13:18:09 2021 +0100
+++ b/roundup/cgi/client.py	Tue Dec 07 11:15:04 2021 -0500
@@ -2492,9 +2492,15 @@
         self.write(content)
 
     def setHeader(self, header, value):
-        """Override a header to be returned to the user's browser.
+        """Override or delete a header to be returned to the user's browser.
         """
-        self.additional_headers[header] = value
+        if value is None:
+            try:
+                del(self.additional_headers[header])
+            except KeyError:
+                pass
+        else:
+            self.additional_headers[header] = value
 
     def header(self, headers=None, response=None):
         """Put up the appropriate header.

Roundup Issue Tracker: http://roundup-tracker.org/