fix(http): decode header values as ISO-8859-1 (#3586)

* fix(http): decode response header values as ISO-8859-1

Response header values were decoded with String::from_utf8 before being
sent over IPC. Raw UTF-8 bytes produced JS strings with code points
above 255, which new Headers() rejects as invalid ByteStrings
("Type error" on WebKit), and bytes that were not valid UTF-8 failed
the fetch outright. Decode as ISO-8859-1 instead so every byte maps to a
char 0-255, matching what browsers expose for the same response.

Fixes #2898

* fix(http): add tests for ISO-8859-1 response header decoding

Cover the #2898 Content-Disposition case and non-UTF-8 header bytes on
the same conversion fetch_send uses, so a revert to UTF-8 fails the suite.

* request headers, e2e test

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
This commit is contained in:
Christopher PruijsenandLucas Nogueira authored and GitHub committed 2026-10-13 14:43:50 -03:00
1 parent 62b3565fb5
commit 0e17675653
6 files changed
+141 -7

No files matched your search

@@ -11,6 +11,9 @@
"https://tauri.app",
{
"url": "http://localhost:3003"
},
{
"url": "http://127.0.0.1:3004"
}
]
},