Content Security Policy 지시사항을 위반하여 스크립트 'site.com/cdn-cgi/speculation' 로딩이 거부되었습니다

console.log를 확인했는데 다음과 같은 오류가 발생했습니다. 이유가 뭘까요? Google Analytics가 AdSense 사용자 승인 기능을 인식하지 못합니다. 그래서 콘솔 영역을 살펴볼 때 이 문제를 발견했습니다. 원인이 무엇이라고 생각하시나요?

오류

다음 Content Security Policy 지시문: "script-src ‘nonce-7mgUxkI7bU1WPKnOwauZMiIwN’ ‘strict-dynamic’"을(를) 위반했기 때문에 스크립트 ‘Login | HSTS Redirection Community’ 로드 거부.

Speculation-Rules 헤더에서 "Login | HSTS Redirection Community"으로 요청된 규칙 세트에 대한 로드가 실패하거나 취소되었습니다 (net::ERR_ABORTED).

There is another recent topic related to content security policy errors with a script at https://forum.example.com/cdn-cgi/speculation: Issue with Activate Account Page After Update to 3.4.0 (Blank Page). I’m wondering if something has changed recently either on Cloudflare or on Discourse.

My understanding is that the /cdn-cgi/speculation endpoint is added to domains registered on Cloudflare if “Speed Brain” is enabled. It is intended to allow Cloudflare to prefetch page content when a user hovers over a link. I’m not sure if it’s compatible with Discourse.

What version of Discourse is your site on?

Are you getting any errors on the site, or are you just seeing the CSP error in the console?

Can you try disabling Speed Brain? It seems that it’s enabled by default. It can be disabled from the “Speed” tab of your Cloudflare dashboard: Speed Brain · Cloudflare Speed docs.

I didn’t know about this new feature of Cloudflare, I haven’t entered the panel for a long time, this is something new. After disabling it, the errors disappeared. I guess this feature has no use in systems like Discourse, or did I misunderstand?

https://community.cloudflare.com/t/cdn-cgi-speculation-applies-even-if-disabled/714033

I don’t think it could work with Discourse. My guess is that it attempts to pre-fetch HTML. Discourse is a javascript application, so pre-fetching HTML will not work.