Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 31 lines (21 sloc) 0.868 kB
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
1 import random
2 import string
3 from base import *
4 from util import *
5
6 LENGTH = 100*1024
7 OFFSET = 15
8
9
10 class Test (TestBase):
11 def __init__ (self):
bc8d926 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@2179 5dc97367-9…
alobbs authored
12 TestBase.__init__ (self, __file__)
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
13 self.name = "Content Range 100k, end"
14
15 self.request = "GET /Range100k2 HTTP/1.0\r\n" +\
16 "Range: bytes=-%d\r\n" % (OFFSET)
17 self.expected_error = 206
18
19 def Prepare (self, www):
20 srandom = str_random (LENGTH)
21 self.WriteFile (www, "Range100k2", 0444, srandom)
22
23 forbidden = self.WriteTemp (srandom[OFFSET:])
24
9134084 @alobbs Fixes Range management while serving static files. Patch by Antonio
alobbs authored
25 self.expected_content = [srandom[-OFFSET:],
26 "Content-Length: %d" % (OFFSET),
27 "Content-Range: bytes %d-%d/%d" % (LENGTH-OFFSET, LENGTH-1, LENGTH)]
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
28 self.forbidden_content = "file:" + forbidden
29
30
Something went wrong with that request. Please try again.