Skip to content
Newer
Older
100644 30 lines (25 sloc) 996 Bytes
6fdc2b7 @alobbs Adds a new QA to test the new Full header regex match feature.
alobbs authored
1 from base import *
2 from util import *
3
4 DIR = "test_271"
5 NUM = "2250738585072011"
6
7 # Ilustrates how to implement a rule to protect PHP and Java back-ends
8 # against the 2.2250738585072011e-308 bug:
9 #
10 # http://www.exploringbinary.com/php-hangs-on-numeric-value-2-2250738585072011e-308/
11 # http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/
12 #
13
14 CONF = """
15 vserver!1!rule!2710!match = header
16 vserver!1!rule!2710!match!match = %(NUM)s
17 vserver!1!rule!2710!match!complete = 1
18 vserver!1!rule!2710!handler = custom_error
19 vserver!1!rule!2710!handler!error = 422
20 """ %(globals())
21
22 class Test (TestBase):
23 def __init__ (self):
24 TestBase.__init__ (self, __file__)
25 self.name = "Full header regex match 1"
26 self.request = "GET /%(DIR)s/ HTTP/1.0\r\n" %(globals()) + \
27 "Accept-Language: es, en-gb;q=2.%(NUM)se-308, en;q=0.7\r\n" %(globals())
28 self.conf = CONF
29 self.expected_error = 422
Something went wrong with that request. Please try again.