“CAUTION: provisional headers are shown” in Chrome debugger

前端 未结 30 3553
滥情空心
滥情空心 2020-11-22 11:52

I noticed a strange caution message when looking at downloaded resources using Google chrome inspector (F12):

Caution provisional headers a

30条回答
  •  南方客
    南方客 (楼主)
    2020-11-22 12:19

    If you are developing an Asp.Net Mvc application and you are trying to return a JsonResult in your controller, make sure you add JsonRequestBehavior.AllowGet to the Json method. That fixed it for me.

    public JsonResult GetTaskSubCategories(int id)
    {
        var subcategs = FindSubCategories(id);
    
        return Json(subcategs, JsonRequestBehavior.AllowGet);  //<-- Notice it has two parameters
    }
    

提交回复
热议问题