@@ -76,16 +76,16 @@ public static String createCSP(@NotNull Map<String, String> attributes) {
7676 highlightjs = " http://localhost:" + BuiltInServerManager .getInstance ().getPort () + PREFIX ;
7777 }
7878 }
79- result = "default-src 'none'; script-src 'unsafe-inline' 'unsafe-eval' " + Urls .parseEncoded ("http://localhost:" + BuiltInServerManager .getInstance ().getPort () + PREFIX + "/ scripts/" ).toExternalForm () + highlightjs + "; "
80- + "style-src 'unsafe-inline' https: http: " + Urls .parseEncoded ("http://localhost:" + BuiltInServerManager .getInstance ().getPort () + PREFIX + "/ styles/" ).toExternalForm () + "; "
79+ result = "default-src 'none'; script-src 'unsafe-inline' 'unsafe-eval' " + Urls .parseEncoded ("http://localhost:" + BuiltInServerManager .getInstance ().getPort () + PREFIX + "scripts/" ).toExternalForm () + highlightjs + "; "
80+ + "style-src 'unsafe-inline' https: http: " + Urls .parseEncoded ("http://localhost:" + BuiltInServerManager .getInstance ().getPort () + PREFIX + "styles/" ).toExternalForm () + "; "
8181 + "img-src file: data: localfile: *; connect-src 'none'; font-src *; " +
8282 "object-src data: file: localfile: *;" + // used for interactive SVGs
8383 "media-src 'none'; child-src 'none'; " +
8484 "frame-src 'self' https://player.vimeo.com/ https://www.youtube.com/ https://structurizr.com/" ; // used for vimeo/youtube iframes
8585 } else {
8686 // this will restrict external content as much as possible
87- result = "default-src 'none'; script-src 'unsafe-inline' 'unsafe-eval' " + Urls .parseEncoded ("http://localhost:" + BuiltInServerManager .getInstance ().getPort () + PREFIX + "/ scripts/" ).toExternalForm () + "; "
88- + "style-src 'unsafe-inline' " + Urls .parseEncoded ("http://localhost:" + BuiltInServerManager .getInstance ().getPort () + PREFIX + "/ styles/" ).toExternalForm () + "; "
87+ result = "default-src 'none'; script-src 'unsafe-inline' 'unsafe-eval' " + Urls .parseEncoded ("http://localhost:" + BuiltInServerManager .getInstance ().getPort () + PREFIX + "scripts/" ).toExternalForm () + "; "
88+ + "style-src 'unsafe-inline' " + Urls .parseEncoded ("http://localhost:" + BuiltInServerManager .getInstance ().getPort () + PREFIX + "styles/" ).toExternalForm () + "; "
8989 + "img-src file: data: localfile: ; connect-src 'none'; " +
9090 "font-src " + Urls .parseEncoded ("http://localhost:" + BuiltInServerManager .getInstance ().getPort () + PREFIX + "/" ).toExternalForm () + "; " +
9191 "object-src data: file: localfile: ;" + // used for interactive SVGs
@@ -289,7 +289,7 @@ private static BrowserPanel getBrowserPanel() {
289289
290290 public static String signFile (String file ) {
291291 String md5 = BrowserPanel .calculateMd5 (file , null );
292- return Urls .parseEncoded ("http://localhost:" + BuiltInServerManager .getInstance ().getPort () + PREFIX + "/ image?file=" + getBrowserPanel ().signFile (file ) + "&hash=" + md5 ).toExternalForm ();
292+ return Urls .parseEncoded ("http://localhost:" + BuiltInServerManager .getInstance ().getPort () + PREFIX + "image?file=" + getBrowserPanel ().signFile (file ) + "&hash=" + md5 ).toExternalForm ();
293293 }
294294
295295 private void sendDocument (FullHttpRequest request , @ NotNull VirtualFile file , @ NotNull Project project , @ NotNull Channel channel ) {
0 commit comments