Skip to content

Commit

Permalink
Merge branch 'dev' into refactor/muda-migration
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog authored Aug 13, 2023
2 parents 6842939 + ec82776 commit eed1878
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions core/tauri-runtime-wry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ license = { workspace = true }
edition = { workspace = true }
rust-version = { workspace = true }

[package.metadata.docs.rs]
features = [ "dox" ]

[dependencies]
wry = { version = "0.31", default-features = false, features = [ "file-drop", "protocol" ] }
tauri-runtime = { version = "0.13.0-alpha.6", path = "../tauri-runtime" }
Expand Down
10 changes: 5 additions & 5 deletions core/tauri/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -675,23 +675,23 @@ impl<R: Runtime> WindowManager<R> {
};
match template.render(asset.as_ref(), &Default::default()) {
Ok(asset) => HttpResponseBuilder::new()
.mimetype("text/html")
.mimetype(mime::TEXT_HTML.as_ref())
.body(asset.into_string().as_bytes().to_vec()),
Err(_) => HttpResponseBuilder::new()
.status(500)
.mimetype("text/plain")
.mimetype(mime::TEXT_PLAIN.as_ref())
.body(Vec::new()),
}
}

None => HttpResponseBuilder::new()
.status(404)
.mimetype("text/plain")
.mimetype(mime::TEXT_PLAIN.as_ref())
.body(Vec::new()),
},
_ => HttpResponseBuilder::new()
.status(404)
.mimetype("text/plain")
.mimetype(mime::TEXT_PLAIN.as_ref())
.body(Vec::new()),
}
});
Expand Down Expand Up @@ -1135,7 +1135,7 @@ impl<R: Runtime> WindowManager<R> {
if html.contains('<') && html.contains('>') {
let mut document = tauri_utils::html::parse(html);
tauri_utils::html::inject_csp(&mut document, &csp.to_string());
url.set_path(&format!("text/html,{}", document.to_string()));
url.set_path(&format!("{},{}", mime::TEXT_HTML, document.to_string()));
}
}
}
Expand Down

0 comments on commit eed1878

Please sign in to comment.