Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislearn committed Nov 5, 2024
1 parent 62faebd commit d773bce
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/core/src/fs/named_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,12 +446,14 @@ impl NamedFile {

if self.flags.contains(Flag::ContentDisposition) {
if let Some(content_disposition) = self.content_disposition.take() {
println!("=============content_disposition 0 {}", content_disposition.to_str().unwrap());
res.headers_mut()
.insert(CONTENT_DISPOSITION, content_disposition);
} else if !res.headers().contains_key(CONTENT_DISPOSITION) {
// skip to set CONTENT_DISPOSITION header if it is already set.
match build_content_disposition(&self.path, &self.content_type, None, None) {
Ok(content_disposition) => {
println!("=============content_disposition 1 {}", content_disposition.to_str().unwrap());
res.headers_mut()
.insert(CONTENT_DISPOSITION, content_disposition);
}
Expand Down

0 comments on commit d773bce

Please sign in to comment.