mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 15:51:23 +01:00
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:
parent
bf799c1fa1
commit
c70cfd3d25
3 changed files with 14 additions and 11 deletions
|
|
@ -98,9 +98,9 @@ impl Error {
|
|||
pub(crate) fn to_response(&self) -> Ra<UiaaResponse> {
|
||||
use ErrorKind::{
|
||||
Forbidden, GuestAccessForbidden, LimitExceeded, MissingToken,
|
||||
NotFound, ThreepidAuthFailed, ThreepidDenied, TooLarge,
|
||||
Unauthorized, Unknown, UnknownToken, Unrecognized, UserDeactivated,
|
||||
WrongRoomKeysVersion,
|
||||
NotFound, NotYetUploaded, ThreepidAuthFailed, ThreepidDenied,
|
||||
TooLarge, Unauthorized, Unknown, UnknownToken, Unrecognized,
|
||||
UserDeactivated, WrongRoomKeysVersion,
|
||||
};
|
||||
|
||||
if let Self::Uiaa(uiaainfo) = self {
|
||||
|
|
@ -142,6 +142,7 @@ impl Error {
|
|||
..
|
||||
} => StatusCode::TOO_MANY_REQUESTS,
|
||||
TooLarge => StatusCode::PAYLOAD_TOO_LARGE,
|
||||
NotYetUploaded => StatusCode::GATEWAY_TIMEOUT,
|
||||
_ => StatusCode::BAD_REQUEST,
|
||||
},
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue