mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-29 17:28:53 +00:00
Compute Content-Length more betterly
This commit is contained in:
parent
2a8fa4da7a
commit
bd402ce1f4
@ -89,10 +89,10 @@ class TahoeLAFSRequest(Request, object):
|
||||
}
|
||||
|
||||
if 'content-length' not in headers:
|
||||
# Python 3's cgi module would really, really like us to set
|
||||
# Content-Length. This seems likely to shoot performance in
|
||||
# the foot.
|
||||
headers['content-length'] = len(self.content.getvalue())
|
||||
# Python 3's cgi module would really, really like us to set Content-Length.
|
||||
self.content.seek(0, 2)
|
||||
headers['content-length'] = str(self.content.tell())
|
||||
self.content.seek(0)
|
||||
|
||||
self.fields = FieldStorage(self.content, headers, environ={'REQUEST_METHOD': 'POST'})
|
||||
self.content.seek(0)
|
||||
|
Loading…
Reference in New Issue
Block a user