Skip to content

Commit 5113906

Browse files
committed
Fix the loading for fonts
1 parent 0414660 commit 5113906

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

webapp/src/EventListener/AddContentSecurityPolicyListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function __invoke(ResponseEvent $event): void
1717
// the profiler requires 'unsafe-eval' for script-src 'self'.
1818
$response = $event->getResponse();
1919
$cspExtra = $this->profiler ? "'unsafe-eval'" : "";
20-
$csp = "default-src 'self' https://cdn.jsdelivr.net; style-src 'self' 'unsafe-inline'; script-src 'self' https://cdn.jsdelivr.net 'unsafe-inline' $cspExtra; img-src 'self' data:; worker-src 'self' blob:";
21-
//$response->headers->set('Content-Security-Policy', $csp);
20+
$csp = "font-src 'self' data:; default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' $cspExtra; img-src 'self' data:; worker-src 'self' blob:";
21+
$response->headers->set('Content-Security-Policy', $csp);
2222
}
2323
}

webapp/templates/base.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
3636
inlineMath: [['$', '$'], ['\\(', '\\)']]
3737
},
3838
chtml: {
39-
fontURL: "{{ app.request.basePath }}/mathjax/fonts/TeX", // local TeX font path
39+
fontURL: "{{ app.request.basePath }}/mathjaxfonts", // local TeX font path
4040
scale: 1.0
4141
},
4242
loader: {
4343
paths: {
44-
mathjax: "{{ app.request.basePath }}/mathjax"
44+
mathjax: "{{ app.request.basePath }}/mathjax",
4545
},
4646
load: ['input/tex', 'output/chtml']
4747
}

0 commit comments

Comments
 (0)