mirror of
https://github.com/nmap/nmap.git
synced 2025-12-22 15:39:03 +00:00
http.lua tests using gzip will fail unless zlib is available.
This commit is contained in:
@@ -3159,6 +3159,7 @@ do
|
|||||||
decoded = {"identity"},
|
decoded = {"identity"},
|
||||||
undecoded = {"mystery", "miracle"}
|
undecoded = {"mystery", "miracle"}
|
||||||
})
|
})
|
||||||
|
if have_zlib then
|
||||||
table.insert(content_encoding_tests,
|
table.insert(content_encoding_tests,
|
||||||
{ name = "stacked encoding",
|
{ name = "stacked encoding",
|
||||||
encoding = "identity, gzip, identity",
|
encoding = "identity, gzip, identity",
|
||||||
@@ -3167,6 +3168,16 @@ do
|
|||||||
decoded = {"identity", "gzip", "identity"},
|
decoded = {"identity", "gzip", "identity"},
|
||||||
undecoded = {}
|
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
|
for _, test in ipairs(content_encoding_tests) do
|
||||||
local body, dcd, undcd, err, fragment = decode_body(test.source, test.encoding, test.maxlen)
|
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)")
|
test_suite:add_test(unittest.equal(body, test.target), test.name .. " (body)")
|
||||||
|
|||||||
Reference in New Issue
Block a user