Skip to content

Instantly share code, notes, and snippets.

@kurobeats
Created October 31, 2019 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kurobeats/27db5b43e28b4cf11096d93dadc359b4 to your computer and use it in GitHub Desktop.
Save kurobeats/27db5b43e28b4cf11096d93dadc359b4 to your computer and use it in GitHub Desktop.
Drop requests by response code script for Zap
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