Created
October 31, 2019 22:27
-
-
Save kurobeats/27db5b43e28b4cf11096d93dadc359b4 to your computer and use it in GitHub Desktop.
Drop requests by response code script for Zap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function proxyRequest(msg) { | |
return true | |
} | |
function proxyResponse(msg) { | |
var code = msg.getResponseHeader().getStatusCode() | |
// You can add more codes here | |
if (code == 404 || code == 403 || code == 500 || code == 502) { | |
// Drop the response | |
return false | |
} | |
return true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment