【问题标题】:"Error with Permissions-Policy header" getting after Chrome updateChrome 更新后出现“Permissions-Policy 标头错误”
【发布时间】:2021-04-29 02:19:31
【问题描述】:

将 chrome 更新到版本 88.0.4324.104 后,从控制台窗口出现以下错误

Error with Permissions-Policy header: Parse of permission policy failed because of errors reported by strctured header parser.

从 ASP.NET Core 3.1 和 Aurelia SPA 开发的应用程序。尝试将以下中间件添加到后端

app.Use(async (context, next) =>
           
{      
         context.Response.Headers.Add("Permission-Policy", "geolocation 'none';midi 'none';notifications 'none';push 'none';sync-xhr 'none';microphone 'none';camera 'none';magnetometer 'none';gyroscope 'none';speaker 'self';vibrate 'none';fullscreen 'self';payment 'none';");
         await next(); 
});

但仍然出现控制台错误。

【问题讨论】:

    标签: google-chrome asp.net-core aurelia security-policy


    【解决方案1】:

    我遇到了同样的问题,通过这种方式解决了:

    您创建权限策略的方式不同。

    Permissions-Policy: fullscreen=(self "https://example.com"), geolocation=*, camera=()
    

    Big changes since this was called Feature Policy

    【讨论】:

      猜你喜欢
      • 2021-12-05
      • 2021-05-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-06
      • 2014-01-28
      • 1970-01-01
      相关资源
      最近更新 更多