fiddler 读取本地文件替换响应

 

 

 

 

    static function OnBeforeResponse(oSession: Session) {
        if (m_Hide304s && oSession.responseCode == 304) {
            oSession["ui-hide"] = "true";
        }
        // MessageBox.Show(oSession.RequestMethod);

        if (oSession.RequestMethod == "GET" && oSession.url.indexOf("oBbhUNHFM") > -1) {

            // MessageBox.Show(111111111111);

            var filePath = "E:\\mycode\\akm\\hmm\\js\\1.js"; // 替换为您的文件路径
                        
            var fileContent = System.IO.File.ReadAllText(filePath);
            // FiddlerObject.log("File content: " + fileContent);
            oSession.utilSetResponseBody(fileContent);
        }








}

 

posted @ 2025-02-25 14:18  AngDH  阅读(35)  评论(0)    收藏  举报