FiddlerCore替换图像而无需等待onBeforeResponse

时间:2017-04-09 08:07:32

标签: c# fiddler fiddlercore

有没有办法在不等待onBeforeResponse的情况下用另一个替换图像内容?

现在我正在使用:

onBeforeRequest:

if (oSession.fullUrl.IndexOf(".png") > -1) {
    oSession.fullUrl = "http://localhost/min.png";
}

onBeforeResponse:

if (oSession.fullUrl.IndexOf("http://localhost/") == 0)
{
    oSession.LoadResponseFromFile(Application.StartupPath + "\\" + oSession.fullUrl.Substring(17));
}

1 个答案:

答案 0 :(得分:0)

找到它:

oSession.utilCreateResponseAndBypassServer();
oSession.LoadResponseFromFile(FilePath);