Skip to content

Commit f113bba

Browse files
committed
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.
1 parent fb893b8 commit f113bba

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Fixed:
5151
now include a suffix indicating the content-encoding used to send
5252
the data per rfc7232. Properly validate any form of ETag suffixed or
5353
non-suffixed for If-Match.
54+
- issue2551178 - fix Traceback in Apache WSGI - during file upload
5455

5556
Features:
5657

roundup/cgi/client.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2492,9 +2492,15 @@ def write_file(self, filename):
24922492
self.write(content)
24932493

24942494
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.
24962496
"""
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
24982504

24992505
def header(self, headers=None, response=None):
25002506
"""Put up the appropriate header.

roundup/rest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,11 +1256,11 @@ def post_collection_inner(self, class_name, input):
12561256

12571257
self.client.setHeader(
12581258
"Allow",
1259-
""
1259+
None
12601260
)
12611261
self.client.setHeader(
12621262
"Access-Control-Allow-Methods",
1263-
""
1263+
None
12641264
)
12651265

12661266
# set the response body

0 commit comments

Comments
 (0)