fix(proxy): enable gzip compression for non-streaming proxy requests

Non-streaming requests were forced to use `Accept-Encoding: identity`,
preventing upstream response compression and increasing bandwidth usage.

Now only streaming requests conservatively keep `identity` to avoid
decompression errors on interrupted SSE streams. Non-streaming requests
let reqwest auto-negotiate gzip and transparently decompress responses.
This commit is contained in:
Jason
2026-03-15 22:01:57 +08:00
parent 81897ac17e
commit 28afbea917
3 changed files with 110 additions and 4 deletions

View File

@@ -38,7 +38,7 @@ tauri-plugin-deep-link = "2"
dirs = "5.0"
toml = "0.8"
toml_edit = "0.22"
reqwest = { version = "0.12", features = ["rustls-tls", "json", "stream", "socks"] }
reqwest = { version = "0.12", features = ["rustls-tls", "json", "stream", "socks", "gzip"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread", "time", "sync"] }
futures = "0.3"
async-stream = "0.3"