Skip to content

Commit 3de02b0

Browse files
authored
Merge pull request #668 from AikidoSec/check-gzip-mock
Check if Accept-Encoding header contains gzip (mock server)
2 parents ef47503 + 758038c commit 3de02b0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

end2end/server/src/handlers/lists.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ module.exports = function lists(req, res) {
1212
throw new Error("App is missing");
1313
}
1414

15+
// Check if Accept-Encoding header contains 'gzip'
16+
const acceptEncoding = req.get("accept-encoding") || "";
17+
if (!acceptEncoding.toLowerCase().includes("gzip")) {
18+
return res.status(400).json({
19+
success: false,
20+
error:
21+
"Accept-Encoding header must include 'gzip' for firewall lists endpoint",
22+
});
23+
}
24+
1525
const blockedIps = getBlockedIPAddresses(req.app);
1626
const blockedUserAgents = getBlockedUserAgents(req.app);
1727
const allowedIps = getAllowedIPAddresses(req.app);

0 commit comments

Comments
 (0)