Skip to content

Commit

Permalink
fix: content disposition filename should quoted (#971)
Browse files Browse the repository at this point in the history
* fix: content disposition filename should quoted

* ci

* test

* Format Rust code using rustfmt

* wip

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
chrislearn and github-actions[bot] authored Nov 5, 2024
1 parent 3cb592b commit a540823
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/core/src/fs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ mod test {
assert_eq!(
file.content_disposition(),
Some(&HeaderValue::from_static(
"attachment; filename=attach.file"
r#"attachment; filename="attach.file""#
))
);
}
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/fs/named_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ fn build_content_disposition(
.unwrap_or_else(|| "file".into())
.into(),
};
format!("attachment; filename={attached_name}")
format!(r#"attachment; filename="{attached_name}""#)
.parse::<HeaderValue>()
.map_err(Error::other)?
} else {
Expand Down

0 comments on commit a540823

Please sign in to comment.