Have Media db return optional content_type, conversion fixes
This commit is contained in:
parent
bb24f6ad90
commit
b6d721374f
5 changed files with 47 additions and 31 deletions
|
@ -66,7 +66,7 @@ pub async fn get_content_route(
|
|||
{
|
||||
Ok(get_content::Response {
|
||||
file,
|
||||
content_type: Some(content_type),
|
||||
content_type,
|
||||
content_disposition: filename,
|
||||
}
|
||||
.into())
|
||||
|
@ -116,11 +116,7 @@ pub async fn get_content_thumbnail_route(
|
|||
.try_into()
|
||||
.map_err(|_| Error::BadRequest(ErrorKind::InvalidParam, "Width is invalid."))?,
|
||||
)? {
|
||||
Ok(get_content_thumbnail::Response {
|
||||
file,
|
||||
content_type: Some(content_type),
|
||||
}
|
||||
.into())
|
||||
Ok(get_content_thumbnail::Response { file, content_type }.into())
|
||||
} else if &*body.server_name != db.globals.server_name() && body.allow_remote {
|
||||
let get_thumbnail_response = server_server::send_request(
|
||||
&db.globals,
|
||||
|
|
|
@ -510,8 +510,7 @@ async fn join_room_by_id_helper(
|
|||
.expect("event is valid, we just created it"),
|
||||
);
|
||||
|
||||
// TODO fixup CanonicalJsonValue
|
||||
// use that instead of serde_json::Map... maybe?
|
||||
// Convert `serde_json;:Value` to `CanonicalJsonObj` for hashing/signing
|
||||
let mut canon_json_stub: BTreeMap<_, ruma::signatures::CanonicalJsonValue> =
|
||||
serde_json::from_value(join_event_stub_value).expect("json Value is canonical JSON");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue