fix(security): disable browsing topics api in astro and nginx config
Add Permissions-Policy header to disable browsing-topics API to prevent Yandex.Metrika attestation errors
This commit is contained in:
@@ -15,6 +15,11 @@ export default defineConfig({
|
|||||||
prefixDefaultLocale: false,
|
prefixDefaultLocale: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
server: {
|
||||||
|
headers: {
|
||||||
|
'Permissions-Policy': 'browsing-topics=()',
|
||||||
|
},
|
||||||
|
},
|
||||||
env: {
|
env: {
|
||||||
schema: {
|
schema: {
|
||||||
YCLIENTS_API_URL: envField.string({ context: 'server', access: 'public' }),
|
YCLIENTS_API_URL: envField.string({ context: 'server', access: 'public' }),
|
||||||
|
|||||||
@@ -18,6 +18,9 @@ http {
|
|||||||
gzip_proxied expired no-cache no-store private auth;
|
gzip_proxied expired no-cache no-store private auth;
|
||||||
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
||||||
|
|
||||||
|
# Fix Yandex.Metrika Topics API attestation error
|
||||||
|
add_header Permissions-Policy "browsing-topics=()" always;
|
||||||
|
|
||||||
error_page 404 /404.html;
|
error_page 404 /404.html;
|
||||||
location = /404.html {
|
location = /404.html {
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
|
|||||||
Reference in New Issue
Block a user