summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/api.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/api.py b/tests/api.py
index da82d37..f76abc7 100644
--- a/tests/api.py
+++ b/tests/api.py
@@ -208,7 +208,9 @@ class PushServer:
self.send_response(200)
self.end_headers()
- q.put((self.path, self.headers, self.rfile.read(int(self.headers['content-length']))))
+ q.put((self.path,
+ self.headers,
+ self.rfile.read(int(self.headers.get('content-length', 0)))))
server = self.server = http.server.ThreadingHTTPServer(("localhost", PUSH_PORT), Handler)
threading.Thread(target=server.serve_forever).start()