summaryrefslogtreecommitdiff
path: root/tests/api.py
diff options
context:
space:
mode:
authorpennae <github@quasiparticle.net>2023-02-04 02:16:02 +0100
committerpennae <github@quasiparticle.net>2023-02-04 02:31:51 +0100
commit65bfd803eb943078cf3608003039708c06f58454 (patch)
tree4dbdbef0fe1b4e596fa98307c7b5086e3c109f25 /tests/api.py
parentf2b7857f530c7c33a3157e1235a382424b919df7 (diff)
downloadminor-skulk-65bfd803eb943078cf3608003039708c06f58454.tar.gz
minor-skulk-65bfd803eb943078cf3608003039708c06f58454.tar.xz
minor-skulk-65bfd803eb943078cf3608003039708c06f58454.zip
switch to hyper backend for web-push
upgrading dependencies will mean we have to use hyper for web-push instead of isahc. sadly hyper doesn't send content-length headers for empty bodies, but we can fudge that for the tests.
Diffstat (limited to 'tests/api.py')
-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()