mirror of
https://gitlab.com/famedly/conduit.git
synced 2025-09-05 18:41:00 +00:00
fix: Respond with HTTP code 413, when request size is too big
This commit is contained in:
parent
617ea3614e
commit
8f3959b3f3
2 changed files with 1 additions and 4 deletions
|
@ -61,9 +61,7 @@ where
|
|||
.await
|
||||
.map_err(|err| {
|
||||
if std::error::Error::source(&err).as_ref().and_then(|err| std::error::Error::source(err)).is_some() {
|
||||
Error::BadRequest(
|
||||
ErrorKind::ResourceLimitExceeded{ admin_contact: String::default() },
|
||||
"Reached maximum request size")
|
||||
Error::BadRequest(ErrorKind::TooLarge, "Reached maximum request size")
|
||||
} else {
|
||||
Error::BadRequest(ErrorKind::Unknown, "An unknown error has occurred")
|
||||
}
|
||||
|
|
|
@ -123,7 +123,6 @@ impl Error {
|
|||
Unauthorized | UnknownToken { .. } | MissingToken => StatusCode::UNAUTHORIZED,
|
||||
NotFound | Unrecognized => StatusCode::NOT_FOUND,
|
||||
LimitExceeded { .. } => StatusCode::TOO_MANY_REQUESTS,
|
||||
ResourceLimitExceeded { .. } => StatusCode::PAYLOAD_TOO_LARGE,
|
||||
UserDeactivated => StatusCode::FORBIDDEN,
|
||||
TooLarge => StatusCode::PAYLOAD_TOO_LARGE,
|
||||
ConnectionTimeout => StatusCode::GATEWAY_TIMEOUT,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue