aboutsummaryrefslogtreecommitdiff
path: root/dummyserver/handlers.py
diff options
context:
space:
mode:
authorSVN-Git Migration <python-modules-team@lists.alioth.debian.org>2015-10-08 13:19:43 -0700
committerSVN-Git Migration <python-modules-team@lists.alioth.debian.org>2015-10-08 13:19:43 -0700
commite6838673bda9af1e9bf7c4f71b25cf3e3dfc1253 (patch)
tree9b3a790337eee838225caa031f8051123157e6f0 /dummyserver/handlers.py
parentc9df3d807f7134f58f4a84dc8b80e9dc98c62f3a (diff)
downloadpython-urllib3-e6838673bda9af1e9bf7c4f71b25cf3e3dfc1253.tar
python-urllib3-e6838673bda9af1e9bf7c4f71b25cf3e3dfc1253.tar.gz
Imported Upstream version 1.11
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()