Return 504 when a file is missing to be by-spec

The spec defines that the media endpoints should return 504 when a file
is not-yet-uploaded, which has been interpreted to include when a file
was deleted. Modifies the /media/v3/download/ and /media/r0/thumbnail
endpoints.
This commit is contained in:
tranquillity-codes 2024-06-28 10:01:41 +02:00 committed by Charles Hall
parent bf799c1fa1
commit c70cfd3d25
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
3 changed files with 14 additions and 11 deletions

View file

@ -250,7 +250,7 @@ async fn get_content_route_ruma(
cross_origin_resource_policy: Some("cross-origin".to_owned()),
})
} else {
Err(Error::BadRequest(ErrorKind::NotFound, "Media not found."))
Err(Error::BadRequest(ErrorKind::NotYetUploaded, "Media not found."))
}
}
@ -415,6 +415,6 @@ async fn get_content_thumbnail_route_ruma(
cross_origin_resource_policy: Some("cross-origin".to_owned()),
})
} else {
Err(Error::BadRequest(ErrorKind::NotFound, "Media not found."))
Err(Error::BadRequest(ErrorKind::NotYetUploaded, "Media not found."))
}
}