Message7403
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. |
|
Date |
User |
Action |
Args |
2021-12-07 15:18:11 | rouilj | set | recipients:
+ rouilj, schlatterbeck |
2021-12-07 15:18:11 | rouilj | link | issue2551178 messages |
2021-12-07 15:18:11 | rouilj | create | |
|