From e6838673bda9af1e9bf7c4f71b25cf3e3dfc1253 Mon Sep 17 00:00:00 2001 From: SVN-Git Migration Date: Thu, 8 Oct 2015 13:19:43 -0700 Subject: Imported Upstream version 1.11 --- dummyserver/handlers.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'dummyserver/handlers.py') 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() -- cgit v1.2.3