Skip to content
This repository
Newer
Older
100644 36 lines (28 sloc) 0.946 kb
06511e3d »
2008-04-25 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1413 5dc97367-9…
1 from base import *
2
3 DIR = "header_test1_referer_match"
44411ce1 »
2008-05-21 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1452 5dc97367-9…
4 REFERER = "example.158ext"
5 MAGIC = "Dealing with rule based headers.."
06511e3d »
2008-04-25 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1413 5dc97367-9…
6
7 CONF = """
8e7efc49 »
2008-08-05 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1738 5dc97367-9…
8 vserver!1!rule!1580!match = header
9 vserver!1!rule!1580!match!header = Referer
10 vserver!1!rule!1580!match!match = .+\.158ext
11 vserver!1!rule!1580!handler = cgi
06511e3d »
2008-04-25 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1413 5dc97367-9…
12 """
13
14 CGI = """#!/bin/sh
15
e171beed »
2008-05-02 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1425 5dc97367-9…
16 echo "Content-Type: text/plain"
72f64441 »
2009-12-13 Clean up: Trims trailing spaces.
17 echo
44411ce1 »
2008-05-21 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1452 5dc97367-9…
18 echo "%s"
19 """ % (MAGIC)
06511e3d »
2008-04-25 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1413 5dc97367-9…
20
21 class Test (TestBase):
22 def __init__ (self):
bc8d9265 »
2008-10-14 git-svn-id: svn://cherokee-project.com/cherokee/trunk@2179 5dc97367-9…
23 TestBase.__init__ (self, __file__)
bda773ba »
2008-04-29 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1423 5dc97367-9…
24 self.name = "Rule header: match I"
06511e3d »
2008-04-25 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1413 5dc97367-9…
25
26 self.request = "GET /%s/test HTTP/1.0\r\n" % (DIR) + \
27 "Referer: %s\r\n" % (REFERER)
28 self.conf = CONF
29 self.expected_error = 200
44411ce1 »
2008-05-21 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1452 5dc97367-9…
30 self.required_content = MAGIC
06511e3d »
2008-04-25 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1413 5dc97367-9…
31 self.forbidden_content = ["/bin/sh", "echo"]
32
33 def Prepare (self, www):
34 d = self.Mkdir (www, DIR)
44411ce1 »
2008-05-21 git-svn-id: svn://cherokee-project.com/cherokee/trunk@1452 5dc97367-9…
35 f = self.WriteFile (d, 'test', 0755, CGI)
Something went wrong with that request. Please try again.