From d0940a8b194805173dae029d0fe284974ffecc7a Mon Sep 17 00:00:00 2001 From: Vendicated Date: Sun, 25 Sep 2022 17:45:59 +0200 Subject: Make raw.githubusercontent.com work for css imports --- src/patcher.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/patcher.ts') diff --git a/src/patcher.ts b/src/patcher.ts index 8e28fd1..a1aba2d 100644 --- a/src/patcher.ts +++ b/src/patcher.ts @@ -57,6 +57,11 @@ electron.app.whenReady().then(() => { if (responseHeaders) { delete responseHeaders["content-security-policy-report-only"]; delete responseHeaders["content-security-policy"]; + + // Fix hosts that don't properly set the content type, such as + // raw.githubusercontent.com + if (url.endsWith(".css")) + responseHeaders["content-type"] = ["text/css"]; } cb({ cancel: false, responseHeaders }); }); -- cgit