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()
|
.next()
|
||||||
.ok_or_else(|| Error::bad_database("Media ID in db is invalid."))?;
|
.ok_or_else(|| Error::bad_database("Media ID in db is invalid."))?;
|
||||||
|
|
||||||
let content_disposition = content_disposition_bytes
|
let content_disposition = content_disposition_bytes.try_into().unwrap_or_else(|_| {
|
||||||
.try_into()
|
ContentDisposition::new(ruma::http_headers::ContentDispositionType::Inline)
|
||||||
.map_err(|_| Error::bad_database("Content Disposition in mediaid_file is invalid."))?;
|
});
|
||||||
Ok((content_disposition, content_type, key))
|
Ok((content_disposition, content_type, key))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue