Implement max_request_size config option
This commit is contained in:
parent
3451b10a4b
commit
fa2da9e048
3 changed files with 24 additions and 16 deletions
|
@ -2977,11 +2977,11 @@ pub fn send_event_to_device_route(
|
|||
}
|
||||
|
||||
#[get("/_matrix/media/r0/config")]
|
||||
pub fn get_media_config_route() -> ConduitResult<get_media_config::Response> {
|
||||
Ok(get_media_config::Response {
|
||||
upload_size: (20_u32 * 1024 * 1024).into(), // 20 MB
|
||||
}
|
||||
.into())
|
||||
pub fn get_media_config_route(
|
||||
db: State<'_, Database>,
|
||||
) -> ConduitResult<get_media_config::Response> {
|
||||
let upload_size = db.globals.max_request_size().into();
|
||||
Ok(get_media_config::Response { upload_size }.into())
|
||||
}
|
||||
|
||||
#[post("/_matrix/media/r0/upload", data = "<body>")]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue