Skip to content

Commit 8b0f1fa

Browse files
committed
fix: markdown viewer doesnt appear in prod windows builds
1 parent 9faabfd commit 8b0f1fa

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src-tauri/src/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,8 +829,12 @@ fn main() {
829829
#[cfg(not(windows))]
830830
let window_origin = "phtauri://localhost";
831831

832+
// Wildcard ACAO so CORS succeeds for null-origin sandboxed iframes (the
833+
// markdown viewer is sandboxed without allow-same-origin to contain
834+
// untrusted markdown). Safe: phtauri://localhost isn't reachable from
835+
// outside the Tauri webview, and these responses carry no credentials.
832836
let builder = ResponseBuilder::new()
833-
.header("Access-Control-Allow-Origin", window_origin)
837+
.header("Access-Control-Allow-Origin", "*")
834838
.header("Origin", window_origin)
835839
.header("Cache-Control", "private, max-age=7776000, immutable") // 3 month cache age expiry
836840
.mimetype(&asset.mime_type);

0 commit comments

Comments
 (0)