| ... | @@ -46,10 +46,14 @@ const DESKTOP_RENDERER_ORIGINS = ["t3code://app", "t3code-dev://app"]; | ... | @@ -46,10 +46,14 @@ const DESKTOP_RENDERER_ORIGINS = ["t3code://app", "t3code-dev://app"]; |
| 46 | const SVG_CONTENT_SECURITY_POLICY = "default-src 'none'; style-src 'unsafe-inline'; sandbox"; | 46 | const SVG_CONTENT_SECURITY_POLICY = "default-src 'none'; style-src 'unsafe-inline'; sandbox"; |
| 47 | | 47 | |
| 48 | export function assetResponseHeaders(filePath: string): Record<string, string> { | 48 | export function assetResponseHeaders(filePath: string): Record<string, string> { |
| | 49 | const lowerPath = filePath.toLowerCase(); |
| 49 | return { | 50 | return { |
| 50 | "Cache-Control": "private, max-age=3600", | 51 | "Cache-Control": "private, max-age=3600", |
| 51 | "X-Content-Type-Options": "nosniff", | 52 | "X-Content-Type-Options": "nosniff", |
| 52 | ...(filePath.toLowerCase().endsWith(".svg") | 53 | ...(lowerPath.endsWith(".html") || lowerPath.endsWith(".htm") |
| | 54 | ? { "Content-Type": "text/html; charset=utf-8" } |
| | 55 | : {}), |
| | 56 | ...(lowerPath.endsWith(".svg") |
| 53 | ? { "Content-Security-Policy": SVG_CONTENT_SECURITY_POLICY } | 57 | ? { "Content-Security-Policy": SVG_CONTENT_SECURITY_POLICY } |
| 54 | : {}), | 58 | : {}), |
| 55 | }; | 59 | }; |