tauri-apps / tauri-apps/plugins-workspace
@tauri-apps/plugin-http throw Type error when Content-Disposition filename contains Chinese character.
- Dominant language
- Rust
- Stars
- 1.8k
- Forks
- 602
- Avg merge
- 4d 14h
- Merged PRs (30d)
- 9
Description
### Problem:
@tauri-apps/plugin-http throw Type error when Content-Disposition filename contains Chinese character, Chinese character encoding with UTF-8.
if filename is ASCII chars, it works ok.
### Version
"@tauri-apps/plugin-http": "^2.5.1",
tauri = { version = "2", features = [] }
### Demo URL:
curl -I https://www.domain.com/download?id=123
HTTP/1.1 200 Connection established
HTTP/1.1 200 OK
Content-Type: application/octet-stream
Connection: keep-alive
Access-Control-Allow-Origin: *
Cache-control: max-age=86400
Content-Transfer-Encoding: binary
Pragma: public
Content-Disposition: attachment; filename="中文-EN.pdf"
### Demo code:
```js
const { fetch } = await import('@tauri-apps/plugin-http');
let headResponse;
try {
headResponse = await fetch(url, { method: 'HEAD' });
} catch (error) {
console.warn('await fetch url error: ', error, url);
throw new Error('await fetch url error!');
}
```
Contributor guide
Assessment
This issue has not been assessed yet.