From e1bf6ef8cbe3421eeaec47a222446121bcc28354 Mon Sep 17 00:00:00 2001 From: Huang Xin Date: Thu, 17 Oct 2024 13:41:27 +0200 Subject: [PATCH] fix(core): expose `content-range` header in `asset` protocol (#11374) --- .changes/asset-protocol-expose-content-range.md | 5 +++++ crates/tauri/src/protocol/asset.rs | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changes/asset-protocol-expose-content-range.md diff --git a/.changes/asset-protocol-expose-content-range.md b/.changes/asset-protocol-expose-content-range.md new file mode 100644 index 000000000000..055a9ac1402f --- /dev/null +++ b/.changes/asset-protocol-expose-content-range.md @@ -0,0 +1,5 @@ +--- +"tauri": patch:bug +--- + +Expose `content-range` header in `range` response of `asset` protocol diff --git a/crates/tauri/src/protocol/asset.rs b/crates/tauri/src/protocol/asset.rs index da7085a4c88b..7fd7f1655a55 100644 --- a/crates/tauri/src/protocol/asset.rs +++ b/crates/tauri/src/protocol/asset.rs @@ -86,6 +86,7 @@ fn get_response( .and_then(|r| r.to_str().map(|r| r.to_string()).ok()) { resp = resp.header(ACCEPT_RANGES, "bytes"); + resp = resp.header(ACCESS_CONTROL_EXPOSE_HEADERS, "content-range"); let not_satisfiable = || { Response::builder()