Warm tip: This article is reproduced from serverfault.com, please click

asp.net core-Chrome 更新后出现“权限策略标题错误”

(asp.net core - "Error with Permissions-Policy header" getting after Chrome update)

发布于 2021-01-25 09:28:56

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

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

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

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(); 
});

但仍然收到控制台错误。

Questioner
Sithira Pathirana
Viewed
0
Dereckson Santana 2021-01-26 18:53:27

我有同样的问题,它是这样解决的:

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

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

自从这被称为功能策略以来的重大变化