Mercurial > p > roundup > code
changeset 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 | 982460ed0a23 |
| children | 5a3a386aa8e7 |
| files | CHANGES.txt roundup/cgi/client.py roundup/rest.py |
| diffstat | 3 files changed, 11 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/CHANGES.txt Tue Dec 07 13:18:09 2021 +0100 +++ b/CHANGES.txt Tue Dec 07 11:15:04 2021 -0500 @@ -51,6 +51,7 @@ now include a suffix indicating the content-encoding used to send the data per rfc7232. Properly validate any form of ETag suffixed or non-suffixed for If-Match. +- issue2551178 - fix Traceback in Apache WSGI - during file upload Features:
--- 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.
