mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-29 14:04:19 +03:00
This commit is contained in:
parent
fe18012d30
commit
4bf1c55b0d
@ -1,5 +0,0 @@
|
||||
---
|
||||
"tauri": patch:enhance
|
||||
---
|
||||
|
||||
Use a strict content security policy on the isolation pattern HTML.
|
@ -10,8 +10,6 @@ use std::sync::Arc;
|
||||
|
||||
use crate::{manager::webview::PROCESS_IPC_MESSAGE_FN, webview::UriSchemeProtocolHandler};
|
||||
|
||||
const CSP: &str = "default-src: 'none'";
|
||||
|
||||
pub fn get(assets: Arc<EmbeddedAssets>, aes_gcm_key: [u8; 32]) -> UriSchemeProtocolHandler {
|
||||
Box::new(move |request, responder| {
|
||||
let response = match request_to_path(&request).as_str() {
|
||||
@ -25,7 +23,6 @@ pub fn get(assets: Arc<EmbeddedAssets>, aes_gcm_key: [u8; 32]) -> UriSchemeProto
|
||||
match template.render(asset.as_ref(), &Default::default()) {
|
||||
Ok(asset) => http::Response::builder()
|
||||
.header(CONTENT_TYPE, mime::TEXT_HTML.as_ref())
|
||||
.header("Content-Security-Policy", CSP)
|
||||
.body(asset.into_string().as_bytes().to_vec()),
|
||||
Err(_) => http::Response::builder()
|
||||
.status(http::StatusCode::INTERNAL_SERVER_ERROR)
|
||||
|
1
examples/api/src-tauri/Cargo.lock
generated
1
examples/api/src-tauri/Cargo.lock
generated
@ -3302,7 +3302,6 @@ dependencies = [
|
||||
"gtk",
|
||||
"http",
|
||||
"jni",
|
||||
"log",
|
||||
"percent-encoding",
|
||||
"raw-window-handle 0.6.0",
|
||||
"softbuffer",
|
||||
|
Loading…
Reference in New Issue
Block a user