fix(reader): remove foliate allow-scripts and add CSP for EPUB resources
This commit is contained in:
@@ -68,7 +68,9 @@ public class EpubReaderController {
|
||||
"application/vnd.ms-fontobject".equals(contentType)) {
|
||||
response.setHeader("Access-Control-Allow-Origin", "*");
|
||||
}
|
||||
|
||||
// Defense in depth for untrusted EPUB resources. See Foliate's security guidance:
|
||||
// https://github.com/johnfactotum/foliate-js#security
|
||||
response.setHeader("Content-Security-Policy", "script-src 'none'");
|
||||
response.setHeader("Cache-Control", "public, max-age=3600");
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user