How to add headers to static asset responses with Solid Start?

I want to add a couple headers to all the static asset responses, and can't figure out how to do it. I've tried adding middleware (doesn't apply to static assets), and have tried adding routeRules in the Nitro server config, but these seem to not work either.
export default defineConfig({
start: {
middleware: "./src/middleware/cross-origin-isolation.ts",
ssr: false,
server: {
routeRules: {
"*": {
headers: {
"Cross-Origin-Embedder-Policy": "require-corp",
"Cross-Origin-Opener-Policy": "same-origin",
},
},
},
},
},
}
export default defineConfig({
start: {
middleware: "./src/middleware/cross-origin-isolation.ts",
ssr: false,
server: {
routeRules: {
"*": {
headers: {
"Cross-Origin-Embedder-Policy": "require-corp",
"Cross-Origin-Opener-Policy": "same-origin",
},
},
},
},
},
}
Any ideas how I can accomplish this?
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server