File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
src/packages/frontend/frame-editors/html-editor Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import {
21
21
change_filename_extension ,
22
22
is_different ,
23
23
list_alternatives ,
24
+ path_split ,
24
25
} from "@cocalc/util/misc" ;
25
26
import { debounce } from "lodash" ;
26
27
import { React , ReactDOM , Rendered , CSS } from "../../app-framework" ;
@@ -146,7 +147,13 @@ export const IFrameHTML: React.FC<Props> = React.memo((props: Props) => {
146
147
// extra security and pointed in the right direction.
147
148
// We can't just use <iframe src= since the backend 'raw files' server
148
149
// just always forces a download of that, for security reasons.
149
- const extraHead = `<base href="${ join ( appBasePath , project_id ) } /files/">
150
+ const base = join (
151
+ appBasePath ,
152
+ project_id ,
153
+ "files" ,
154
+ encodeURIComponent ( path_split ( actual_path ) . head ) + "/" ,
155
+ ) ;
156
+ const extraHead = `<base href="${ base } ">
150
157
<meta http-equiv="Content-Security-Policy" content="default-src * data: blob: 'unsafe-inline' 'unsafe-eval';
151
158
script-src * data: blob: 'unsafe-inline' 'unsafe-eval';
152
159
img-src * data: blob:;
You can’t perform that action at this time.
0 commit comments