mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-23 12:38:33 +00:00
Accept both HTTP/413 and HTTP/429 as rate-limit responses.
This commit is contained in:
@@ -86,7 +86,7 @@ public abstract class ServiceResponseProcessor<T> {
|
||||
}
|
||||
|
||||
protected boolean rateLimit() {
|
||||
return response.getStatus() == 413;
|
||||
return response.getStatus() == 413 || response.getStatus() == 429;
|
||||
}
|
||||
|
||||
protected boolean expectationFailed() {
|
||||
|
||||
@@ -1678,6 +1678,7 @@ public class PushServiceSocket {
|
||||
|
||||
switch (responseCode) {
|
||||
case 413:
|
||||
case 429:
|
||||
throw new RateLimitException("Rate limit exceeded: " + responseCode);
|
||||
case 401:
|
||||
case 403:
|
||||
|
||||
@@ -100,6 +100,7 @@ public final class DefaultErrorMapper implements ErrorMapper {
|
||||
return e;
|
||||
}
|
||||
case 413:
|
||||
case 429:
|
||||
return new RateLimitException("Rate limit exceeded: " + status);
|
||||
case 417:
|
||||
return new ExpectationFailedException();
|
||||
|
||||
Reference in New Issue
Block a user