In Fiddler, is there a way to block a response if its body contains a particular word?
If Fiddler is capable of this (possibly through FiddlerScript
?), that'd be awesome. Otherwise, if there is another tool that would be better, I'd love to hear about it.
A similar question was asked at What is the best way to block specific URL for testing?, but in my case I don't want to block a URI entirely, but rather only block certain responses from that URI, so that answer is not applicable.
Possible Leads
In FiddlerScript, there appears to be a function called utilFindInResponse
, which might be incorporated into OnBeforeResponse
like this:
static function OnBeforeResponse(oSession: Session) {
...
if (oSession.utilFindInResponse("WordToBlock", false) > -1){
oSession.responseCode = "404";
}
}
Is this the right way to go about a response-blocker that searches for a particular word?