Secure header

This commit is contained in:
Théo 2023-04-23 22:50:48 +02:00
parent 4b48a6efd5
commit efc84d5d86
2 changed files with 32 additions and 1 deletions

View file

@ -5,6 +5,36 @@ const nextConfig = {
experimental: { experimental: {
appDir: true, appDir: true,
scrollRestoration: true scrollRestoration: true
},
headers: async () => {
return [
{
source: '/(.*)',
headers: [
{
key: 'X-Frame-Options',
value: 'DENY'
},
{
key: 'Content-Security-Policy',
value:
"default-src 'self'; script-src 'self'; font-src 'self' 'https://fonts.googleapis.com'"
},
{
key: 'X-Content-Type-Options',
value: 'nosniff'
},
{
key: 'Permissions-Policy',
value: 'camera=(); battery=(); geolocation=(); microphone=()'
},
{
key: 'Referrer-Policy',
value: 'origin-when-cross-origin'
}
]
}
];
} }
}; };

View file

@ -137,7 +137,8 @@ export default function Puzzle({ token, id }: { token: string; id: number }) {
<div className="flex items-center justify-between"> <div className="flex items-center justify-between">
<div className="items-center gap-x-2"> <div className="items-center gap-x-2">
<p> <p>
Tentative{puzzle.tries && puzzle.tries > 1 ? "s":""} : <span className="text-brand-accent">{puzzle.tries}</span> Tentative{puzzle.tries && puzzle.tries > 1 ? 's' : ''} :{' '}
<span className="text-brand-accent">{puzzle.tries}</span>
</p> </p>
<p> <p>
Score : <span className="text-brand-accent">{puzzle.score}</span> Score : <span className="text-brand-accent">{puzzle.score}</span>