|
|
|
@ -39,10 +39,18 @@ class TestBzip2(DeflateRequest):
|
|
|
|
|
class TestXBzip2(DeflateRequest): |
|
|
|
|
ACCEPT_ENCODING = 'x-bzip2' |
|
|
|
|
|
|
|
|
|
class TestDisableDeflate(CurlRequest): |
|
|
|
|
URL = "/test.txt?nodeflate" |
|
|
|
|
EXPECT_RESPONSE_BODY = TEST_TXT |
|
|
|
|
EXPECT_RESPONSE_CODE = 200 |
|
|
|
|
|
|
|
|
|
EXPECT_RESPONSE_HEADERS = [("Content-Encoding", None)] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Test(GroupTest): |
|
|
|
|
group = [TestGzip, TestXGzip, TestDeflate, TestBzip2, TestXBzip2] |
|
|
|
|
group = [TestGzip, TestXGzip, TestDeflate, TestBzip2, TestXBzip2, TestDisableDeflate] |
|
|
|
|
|
|
|
|
|
def Prepare(self): |
|
|
|
|
self.PrepareVHostFile("test.txt", TEST_TXT) |
|
|
|
|
# deflate is enabled global too; force it here anyway |
|
|
|
|
self.config = """static; do_deflate;""" |
|
|
|
|
self.config = """if req.query == "nodeflate" { req_header.remove "Accept-Encoding"; } static; do_deflate;""" |
|
|
|
|