Roundup Tracker - Issues

Message7403

Author rouilj
Recipients rouilj, schlatterbeck
Date 2021-12-07.15:18:11
Message-id <20211207151806.842326A0192@pe15.cs.umb.edu>
In-reply-to <1638864150.27.0.0128258511087.issue2551178@roundup.psfhosted.org>
Hi Ralf:

In message <1638864150.27.0.0128258511087.issue2551178@roundup.psfhosted.org>,
Ralf Schlatterbeck writes:
>OK found the change that introduced the None values:
>
>changeset:   6525:c505c774a94d
>user:        John Rouillard <rouilj@ieee.org>
>date:        Sun Nov 07 01:04:43 2021 -0500
>files:       CHANGES.txt roundup/rest.py test/rest_common.py test/test_liveserver.py
>description:
>Mutiple changes to REST code.

Well that's a helpful message 8-(. Fortunately the checked in comments
are better.

>John, would you agree that setting these headers to '' instead of
>None would still fulfill the original intention? I've tested this
>will not produce a traceback.

According to what I remember, these headers should not be emitted at
all.

Does this change to client.py solve the issue?

===
@@ -2492,9 +2502,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.
===

Also shouldn't test*Post*() in test/rest_common.py have shown the
issue? Since this appears unique to wsgi, I wonder if a file POST test
case test_liveserver.py can trigger it.
History
Date User Action Args
2021-12-07 15:18:11rouiljsetrecipients: + rouilj, schlatterbeck
2021-12-07 15:18:11rouiljlinkissue2551178 messages
2021-12-07 15:18:11rouiljcreate