1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-22 07:29:01 +00:00

http.lua tests using gzip will fail unless zlib is available.

This commit is contained in:
dmiller
2019-05-24 18:28:49 +00:00
parent bbdac0e8fe
commit 302f5d5bd6

View File

@@ -3159,6 +3159,7 @@ do
decoded = {"identity"},
undecoded = {"mystery", "miracle"}
})
if have_zlib then
table.insert(content_encoding_tests,
{ name = "stacked encoding",
encoding = "identity, gzip, identity",
@@ -3167,6 +3168,16 @@ do
decoded = {"identity", "gzip", "identity"},
undecoded = {}
})
else
table.insert(content_encoding_tests,
{ name = "stacked encoding",
encoding = "identity, gzip, identity",
source = stdnse.fromhex("1f8b0800000000000000f348cdc9c9d75108cf2fca49510400d0c34aec0d000000"),
target = stdnse.fromhex("1f8b0800000000000000f348cdc9c9d75108cf2fca49510400d0c34aec0d000000"),
decoded = {"identity"},
undecoded = {"gzip", "identity"},
})
end
for _, test in ipairs(content_encoding_tests) do
local body, dcd, undcd, err, fragment = decode_body(test.source, test.encoding, test.maxlen)
test_suite:add_test(unittest.equal(body, test.target), test.name .. " (body)")