“CAUTION: provisional headers are shown” in Chrome debugger

前端 未结 30 2950
滥情空心
滥情空心 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:18

    In my case the cause was AdBlock extension.

    The request to server went through and I got the response but I could not see the request cookies due to "Provisional headers.." being shown in Dev tools. After disabling AdBlock for the site, the warning went away and dev tools started to show the cookies again.

    For the change to take effect, it was also necessary to close the Dev tools and refresh the page

    0 讨论(0)
  • 2020-11-22 12:19

    For chrome v72+ what solved it for me was only this:

    go to chrome://flags/ and disable this 3 flags

    • Disable site isolation
    • Enable network service
    • Runs network service in-process

    or you can do it from command line :

    chrome --disable-site-isolation-trials --disable-features=NetworkService,NetworkServiceInProcess
    

    why this happen?

    It seems that Google is refactoring their Chromium engine into modular structure, where different services will be separated into stand-alone modules and processes. They call this process servicification. Network service is the first step, Ui service, Identity service and Device service are coming up. Google provides the official information at the Chromium project site.

    is it dangerous to change that?

    An example is networking: once we have a network service we can choose to run it out of process for better stability/security, or in-process if we're resource constrained. source

    0 讨论(0)
  • 2020-11-22 12:19

    This caution message also occurs if the response is invalid and therefore dropped by the browser.

    In my case the request was correctly sent to the server, the server-side code then produced an error and my custom error handling returned the error message in the HTTP status message field. But this error was not received on the client side, due to invalid characters in the error message (described here http://aspnetwebstack.codeplex.com/workitem/1386) which resulted in corrupt response headers.

    0 讨论(0)
  • 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
    }
    
    0 讨论(0)
  • 2020-11-22 12:20

    That might because you sent an Ajax request, at the same time you jump your page to another one using location.href or something like that. So the previous request failed.

    0 讨论(0)
  • 2020-11-22 12:22

    This message can occur when the website is protected using HSTS. Then, when someone links to the HTTP version of the URL, the browser, as instructed by HSTS, does not issue an HTTP request, but internally redirects to the HTTPS resource securely. This is to avoid HTTPS downgrade attacks such as sslstrip.

    0 讨论(0)
提交回复
热议问题