Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 30 lines (24 sloc) 0.84 kB
231252b @alobbs Implements "HTTP Strict Transport Security" (HSTS).
alobbs authored
1 from base import *
2
3 NICK = "test-2920"
4 MAX_AGE = 123456
5
6 CONF = """
7 vserver!2920!nick = %(NICK)s
8 vserver!2920!document_root = %(droot)s
9 vserver!2920!hsts = 1
10 vserver!2920!hsts!max_age = %(MAX_AGE)s
11 vserver!2920!rule!1!match = default
12 vserver!2920!rule!1!handler = dirlist
13 """
14
15 class Test (TestBase):
16 def __init__ (self):
17 TestBase.__init__ (self, __file__)
18 self.name = "HSTS: Error code and Header"
19 self.request = "HTTP / HTTP/1.0\r\n" + \
20 "Host: %s\r\n" %(NICK)
21 self.expected_error = 301
22 self.expected_content = ["Strict-Transport-Security:", "max-age=%d"%(MAX_AGE)]
23
24 def Prepare (self, www):
25 droot = self.Mkdir (www, "%s_droot"%(NICK))
26
27 vars = globals()
28 vars.update(locals())
29 self.conf = CONF %(vars)
Something went wrong with that request. Please try again.