T
TanStack•3mo ago
ambitious-aqua

Devinxi - Global headers Support?

Prior to devinxi i was using route rules to set the global headers whats the current recommendation for headers.
routeRules: {
'/**': {
headers: {
'Content-Security-Policy': cspHeaders.join('; '),
'X-Content-Type-Options': 'nosniff',
'X-Frame-Options': 'DENY',
'Referrer-Policy': 'strict-origin-when-cross-origin',
'Permissions-Policy': 'geolocation=(), camera=(), microphone=()',
},
},
routeRules: {
'/**': {
headers: {
'Content-Security-Policy': cspHeaders.join('; '),
'X-Content-Type-Options': 'nosniff',
'X-Frame-Options': 'DENY',
'Referrer-Policy': 'strict-origin-when-cross-origin',
'Permissions-Policy': 'geolocation=(), camera=(), microphone=()',
},
},
3 Replies
eastern-cyan
eastern-cyan•3mo ago
I just set this in a nitro.config.ts and it works 🤞
ambitious-aqua
ambitious-aquaOP•3mo ago
Does that work in dev or will it just be in the build artificats?
eastern-cyan
eastern-cyan•3mo ago
Just build artifacts I think You would have to set headers in the vote server somehow

Did you find this page helpful?