浏览代码

fix(core): allow any headers on custom protocol IPC (#9561)

Lucas Fernandes Nogueira 1 年之前
父节点
当前提交
98101cb17f
共有 2 个文件被更改,包括 7 次插入4 次删除
  1. 5 0
      .changes/ipc-allow-headers.md
  2. 2 4
      core/tauri/src/ipc/protocol.rs

+ 5 - 0
.changes/ipc-allow-headers.md

@@ -0,0 +1,5 @@
+---
+"tauri": patch:bug
+---
+
+Allow any headers on the IPC custom protocol.

+ 2 - 4
core/tauri/src/ipc/protocol.rs

@@ -137,10 +137,8 @@ pub fn get<R: Runtime>(manager: Arc<AppManager<R>>, label: String) -> UriSchemeP
 
       Method::OPTIONS => {
         let mut r = http::Response::new(Vec::new().into());
-        r.headers_mut().insert(
-          ACCESS_CONTROL_ALLOW_HEADERS,
-          HeaderValue::from_static("Content-Type, Tauri-Callback, Tauri-Error, Tauri-Channel-Id"),
-        );
+        r.headers_mut()
+          .insert(ACCESS_CONTROL_ALLOW_HEADERS, HeaderValue::from_static("*"));
         respond(r);
       }