fix: URL-encoded filename when downloading in safari (#203)

* fix: URL-encoded filename when downloading in safari

* add test
This commit is contained in:
sigoden
2023-03-31 22:52:07 +08:00
committed by GitHub
parent e43554b795
commit fb5b50f059
2 changed files with 28 additions and 11 deletions

View File

@@ -184,6 +184,17 @@ fn get_file_404(server: TestServer) -> Result<(), Error> {
Ok(())
}
#[rstest]
fn get_file_emoji_path(server: TestServer) -> Result<(), Error> {
let resp = reqwest::blocking::get(format!("{}{BIN_FILE}", server.url()))?;
assert_eq!(resp.status(), 200);
assert_eq!(
resp.headers().get("content-disposition").unwrap(),
"inline; filename=\"😀.bin\"; filename*=UTF-8''%F0%9F%98%80.bin"
);
Ok(())
}
#[rstest]
fn get_file_edit(server: TestServer) -> Result<(), Error> {
let resp = fetch!(b"GET", format!("{}index.html?edit", server.url())).send()?;