Don't use default value in LimitingReader
We can't simply pass the None default on to the read operation as this default is handled differently between different wsgi implementations. Change-Id: I337e797b8dee3dfcf9299fe361cf197a176c8fe2 Fixes: bug 1213106
This commit is contained in:
@@ -290,7 +290,12 @@ class LimitingReader(object):
|
||||
yield chunk
|
||||
|
||||
def read(self, i=None):
|
||||
result = self.data.read(i)
|
||||
# NOTE(jamielennox): We can't simply provide the default to the read()
|
||||
# call as the expected default differs between mod_wsgi and eventlet
|
||||
if i is None:
|
||||
result = self.data.read()
|
||||
else:
|
||||
result = self.data.read(i)
|
||||
self.bytes_read += len(result)
|
||||
if self.bytes_read > self.limit:
|
||||
raise exception.RequestTooLarge()
|
||||
|
||||
Reference in New Issue
Block a user