Непонятки с Content Security Policy и Chrome
От: Glestwid  
Дата: 15.11.22 21:38
Оценка:
Броузер ругается в консоли странной ошибкой. Вот что ему шлется:

Request URL: https://localhost:5001/connect/checksession
Request Method: GET
Status Code: 200
Remote Address: [::1]:5001
Referrer Policy: strict-origin-when-cross-origin

Request Headers:
:authority: localhost:5001
:method: GET
:path: /connect/checksession
:scheme: https
accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
accept-encoding: gzip, deflate, br
accept-language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7


В ответ прилетает 200 с такими хедерами:

Response Headers:
access-control-allow-credentials: true
access-control-allow-headers: Origin, Content-Type, Accept, Client, Authorization, X-Auth-Token, X-Requested-With, OcRequestId, traceparent
access-control-allow-methods: GET, POST, PATCH, PUT, DELETE, OPTIONS
access-control-allow-origin: http://localhost:3000
access-control-expose-headers: X-Auth-Token
content-security-policy: object-src 'none'; block-all-mixed-content; img-src 'self' data:; font-src 'self'; style-src 'self' 'unsafe-inline'; base-uri 'self'; script-src 'self' 'unsafe-inline';
frame-ancestors 'self'

content-type: text/html; charset=UTF-8
cross-origin-embedder-policy: require-corp
cross-origin-opener-policy: same-origin
cross-origin-resource-policy: same-origin
date: Fri, 11 Nov 2022 08:38:59 GMT
permissions-policy: accelerometer=(), autoplay=(), camera=(), encrypted-media=(), fullscreen=*, geolocation=(), gyroscope=(), magnetometer=(), microphone=(), midi=(), payment=(), picture-in-picture=(), sync-xhr=(), usb=()
referrer-policy: strict-origin-when-cross-origin
server: Kestrel
set-cookie: idsrv.session=.; expires=Thu, 11 Nov 2021 08:39:00 GMT; path=/; secure; samesite=none
vary: Origin
x-content-security-policy: default-src 'none'; script-src 'sha256-fa5rxHhZ459izGRP38+h4ud5QXNT0SFaFlh4eqDu3BI='
x-content-type-options: nosniff
x-frame-options: DENY
x-xss-protection: 1; mode=block


Но в консоли фиксируется ошибка:

Refused to frame 'https://localhost:5001/' because an ancestor violates the following Content Security Policy directive:
"frame-ancestors 'self'".



Что ему надо исправить чтоы эта ошибка исчезла? Ведь там уже прописано ему frame-ancestors 'self'.
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.