Skip to content
Newer
Older
100644 46 lines (35 sloc) 1.44 KB
3509796 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@282 5dc97367-97…
alobbs authored
1 from base import *
2
3 SERVER = "hidden_params"
4 REQUEST = "function"
5 PARAMS = "one=001&two=002"
6
7 CONF = """
ddbbee5 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@1715 5dc97367-9…
alobbs authored
8 vserver!1350!nick = %s
9 vserver!1350!document_root = %s
10
11 vserver!1350!rule!1!match = default
12 vserver!1350!rule!1!handler = server_info
13
14 vserver!1350!rule!10!match = request
15 vserver!1350!rule!10!match!request = ^/([^\?]*)$
16 vserver!1350!rule!10!handler = redir
17 vserver!1350!rule!10!handler!rewrite!1!show = 1
18 vserver!1350!rule!10!handler!rewrite!1!substring = /index.php?q=$1
19
20 vserver!1350!rule!20!match = request
21 vserver!1350!rule!20!match!request = ^/([^\?]*)\?(.*)$
22 vserver!1350!rule!20!handler = redir
23 vserver!1350!rule!20!handler!rewrite!2!show = 1
24 vserver!1350!rule!20!handler!rewrite!2!substring = /index.php?q=$1&$2
3509796 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@282 5dc97367-97…
alobbs authored
25 """
26
27 class Test (TestBase):
28 def __init__ (self):
bc8d926 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@2179 5dc97367-9…
alobbs authored
29 TestBase.__init__ (self, __file__)
3509796 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@282 5dc97367-97…
alobbs authored
30 self.name = "Hidden redir with params"
31 self.request = "GET /%s?%s HTTP/1.1\r\n" % (REQUEST, PARAMS) + \
0684479 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@1962 5dc97367-9…
alobbs authored
32 "Host: %s\r\n" % (SERVER) + \
33 "Connection: Close\r\n"
3509796 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@282 5dc97367-97…
alobbs authored
34 self.expected_error = 301
35 self.expected_content = "Location: /index.php?q=%s&%s" % (REQUEST, PARAMS)
36
37 def Prepare (self, www):
38 d = self.Mkdir (www, "hidde_w_params_server")
39 d2 = self.Mkdir (d, "hidde_w_params")
40
ddbbee5 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@1715 5dc97367-9…
alobbs authored
41 self.conf = CONF % (SERVER, d)
3509796 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@282 5dc97367-97…
alobbs authored
42
43 def Precondition (self):
327c12c @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@491 5dc97367-97…
alobbs authored
44 return os.path.exists (look_for_php())
3509796 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@282 5dc97367-97…
alobbs authored
45
Something went wrong with that request. Please try again.