aboutsummaryrefslogtreecommitdiff
path: root/dummyserver/handlers.py
diff options
context:
space:
mode:
Diffstat (limited to 'dummyserver/handlers.py')
-rw-r--r--dummyserver/handlers.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/dummyserver/handlers.py b/dummyserver/handlers.py
index 53fbe4a..ffa1dd3 100644
--- a/dummyserver/handlers.py
+++ b/dummyserver/handlers.py
@@ -73,6 +73,10 @@ class TestingApp(RequestHandler):
""" Handle OPTIONS requests """
self._call_method()
+ def head(self):
+ """ Handle HEAD requests """
+ self._call_method()
+
def _call_method(self):
""" Call the correct method in this class based on the incoming URI """
req = self.request
@@ -232,6 +236,13 @@ class TestingApp(RequestHandler):
return Response(chunks, headers=[('Content-Encoding', 'gzip')])
+ def nbytes(self, request):
+ length = int(request.params.get('length'))
+ data = b'1' * length
+ return Response(
+ data,
+ headers=[('Content-Type', 'application/octet-stream')])
+
def shutdown(self, request):
sys.exit()