comparison 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
comparison
equal deleted inserted replaced
6543:982460ed0a23 6544:9aa8df0b4426
2490 finally: 2490 finally:
2491 f.close() 2491 f.close()
2492 self.write(content) 2492 self.write(content)
2493 2493
2494 def setHeader(self, header, value): 2494 def setHeader(self, header, value):
2495 """Override a header to be returned to the user's browser. 2495 """Override or delete a header to be returned to the user's browser.
2496 """ 2496 """
2497 self.additional_headers[header] = value 2497 if value is None:
2498 try:
2499 del(self.additional_headers[header])
2500 except KeyError:
2501 pass
2502 else:
2503 self.additional_headers[header] = value
2498 2504
2499 def header(self, headers=None, response=None): 2505 def header(self, headers=None, response=None):
2500 """Put up the appropriate header. 2506 """Put up the appropriate header.
2501 """ 2507 """
2502 if headers is None: 2508 if headers is None:

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