mirror of
https://gitlab.com/famedly/conduit.git
synced 2024-12-26 04:23:48 +03:00
fix: Empty content dispositions could create problems
This commit is contained in:
parent
fea85b0894
commit
65fe6b0ab5
1 changed files with 3 additions and 3 deletions
|
@ -63,9 +63,9 @@ impl service::media::Data for KeyValueDatabase {
|
|||
.next()
|
||||
.ok_or_else(|| Error::bad_database("Media ID in db is invalid."))?;
|
||||
|
||||
let content_disposition = content_disposition_bytes
|
||||
.try_into()
|
||||
.map_err(|_| Error::bad_database("Content Disposition in mediaid_file is invalid."))?;
|
||||
let content_disposition = content_disposition_bytes.try_into().unwrap_or_else(|_| {
|
||||
ContentDisposition::new(ruma::http_headers::ContentDispositionType::Inline)
|
||||
});
|
||||
Ok((content_disposition, content_type, key))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue