Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -829,8 +829,12 @@ fn main() {
#[cfg(not(windows))]
let window_origin = "phtauri://localhost";

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