Merge "Fix 500 on GET of many-segment manifest."
This commit is contained in:
commit
3a806a805c
@ -205,10 +205,6 @@ class ProxyLoggingMiddleware(object):
|
||||
elif isinstance(iterable, list):
|
||||
start_response_args[0][1].append(
|
||||
('content-length', str(sum(len(i) for i in iterable))))
|
||||
else:
|
||||
raise Exception('WSGI [proxy-logging]: No content-length '
|
||||
'or transfer-encoding header sent and '
|
||||
'there is content! %r' % chunk)
|
||||
start_response(*start_response_args[0])
|
||||
bytes_sent = 0
|
||||
client_disconnect = False
|
||||
|
@ -391,25 +391,6 @@ class TestProxyLogging(unittest.TestCase):
|
||||
self.assertEquals(resp_body, '')
|
||||
self.assertEquals(log_parts[11], '-')
|
||||
|
||||
def test_no_content_length_no_transfer_encoding_with_str_body(self):
|
||||
app = proxy_logging.ProxyLoggingMiddleware(
|
||||
FakeAppNoContentLengthNoTransferEncoding(
|
||||
body='line1\nline2\n',
|
||||
), {})
|
||||
app.access_logger = FakeLogger()
|
||||
req = Request.blank('/', environ={'REQUEST_METHOD': 'GET'})
|
||||
resp = app(req.environ, start_response)
|
||||
# Python 2.7 can have assertRaises act as a context manager, but python
|
||||
# 2.6 can't. So there's this.
|
||||
try:
|
||||
resp_body = ''.join(resp)
|
||||
except Exception as e:
|
||||
self.assertEquals(
|
||||
"WSGI [proxy-logging]: No content-length or transfer-encoding "
|
||||
"header sent and there is content! 'l'", str(e))
|
||||
else:
|
||||
self.assert_(False)
|
||||
|
||||
def test_req_path_info_popping(self):
|
||||
app = proxy_logging.ProxyLoggingMiddleware(FakeApp(), {})
|
||||
app.access_logger = FakeLogger()
|
||||
|
Loading…
x
Reference in New Issue
Block a user