目录

充电学习中...

Fiddler使用AutoResopnse时遇到跨域问题

修改Customize Rules中的脚本代码,为响应头添加允许跨域的代码。

image.png

例如:

        static function OnBeforeResponse(oSession: Session)
        {
            if (m_Hide304s && oSession.responseCode == 304)
            {
                oSession["ui-hide"] = "true";
            }
            if (oSession.fullUrl.Contains("https://app.poizon.com/api/v1/h5/activity/fire/seckill/getVenueList"))
            {
                oSession.responseCode = 200;
                oSession.oResponse.headers.Add("Access-Control-Allow-Headers", "content-type,x-requested-with");
                oSession.oResponse.headers.Add("Access-Control-Allow-Origin", "https://m.poizon.com");
                oSession.oResponse.headers.Add("access-control-allow-credentials", "true");
                oSession.oResponse.headers.Add("access-control-expose-headers", "*");
            }
        }

标题:Fiddler使用AutoResopnse时遇到跨域问题
作者:Cubeeeee
地址:http://blog.nps.fuguicun.com/articles/2019/12/19/1576737789164.html