Skip to content

Commit

Permalink
use mime crate for manager (#7584)
Browse files Browse the repository at this point in the history
  • Loading branch information
chippers authored Aug 12, 2023
1 parent fbeb5b9 commit e21a449
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/tauri/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,23 +561,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 @@ -1021,7 +1021,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 e21a449

Please sign in to comment.