summary refs log tree commit diff
path: root/synapse/http
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2016-03-29 03:13:25 +0100
committerMatthew Hodgson <matthew@matrix.org>2016-03-29 03:13:25 +0100
commit64b4aead15927be56d7433250462c03f2d1f4565 (patch)
treede735c74c600ff60d34e6c3f1cd19aca4d65709f /synapse/http
parentmake it build (diff)
downloadsynapse-64b4aead15927be56d7433250462c03f2d1f4565.tar.xz
make it work
Diffstat (limited to 'synapse/http')
-rw-r--r--synapse/http/client.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/http/client.py b/synapse/http/client.py
index a735300db0..cfdea91b57 100644
--- a/synapse/http/client.py
+++ b/synapse/http/client.py
@@ -26,6 +26,7 @@ from twisted.web.client import (
     Agent, readBody, FileBodyProducer, PartialDownloadError,
 )
 from twisted.web.http_headers import Headers
+from twisted.web._newclient import ResponseDone
 
 from StringIO import StringIO
 
@@ -266,7 +267,7 @@ class SimpleHttpClient(object):
 
         headers = dict(response.headers.getAllRawHeaders())
 
-        if headers['Content-Length'] > max_size:
+        if 'Content-Length' in headers and headers['Content-Length'] > max_size:
             logger.warn("Requested URL is too large > %r bytes" % (self.max_size,))
             # XXX: do we want to explicitly drop the connection here somehow? if so, how?
             raise # what should we be raising here?