Return correct status code for rate limit error (ref #5332) (#5333)

This commit is contained in:
Nutomic 2025-01-20 14:54:25 +00:00 committed by GitHub
parent dc9abcede1
commit 1d94c26e5a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -245,6 +245,7 @@ cfg_if! {
match self.error_type {
LemmyErrorType::IncorrectLogin => actix_web::http::StatusCode::UNAUTHORIZED,
LemmyErrorType::NotFound => actix_web::http::StatusCode::NOT_FOUND,
LemmyErrorType::RateLimitError => actix_web::http::StatusCode::TOO_MANY_REQUESTS,
_ => actix_web::http::StatusCode::BAD_REQUEST,
}
}