summaryrefslogtreecommitdiff
path: root/cherrypy/test/test_core.py
diff options
context:
space:
mode:
Diffstat (limited to 'cherrypy/test/test_core.py')
-rw-r--r--cherrypy/test/test_core.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/cherrypy/test/test_core.py b/cherrypy/test/test_core.py
index 6966d325..ae4728de 100644
--- a/cherrypy/test/test_core.py
+++ b/cherrypy/test/test_core.py
@@ -496,6 +496,12 @@ class CoreRequestHandlingTest(helper.CPWebCase):
self.getPage("/ranges/get_ranges?bytes=2-4,-1")
self.assertBody("[(2, 5), (7, 8)]")
+ # Test a suffix-byte-range longer than the content
+ # length. Note that in this test, the content length
+ # is 8 bytes.
+ self.getPage("/ranges/get_ranges?bytes=-100")
+ self.assertBody("[(0, 8)]")
+
# Get a partial file.
if cherrypy.server.protocol_version == "HTTP/1.1":
self.getPage("/ranges/slice_file", [('Range', 'bytes=2-5')])