mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-23 20:48:43 +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() {
|
protected boolean rateLimit() {
|
||||||
return response.getStatus() == 413;
|
return response.getStatus() == 413 || response.getStatus() == 429;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean expectationFailed() {
|
protected boolean expectationFailed() {
|
||||||
|
|||||||
@@ -1678,6 +1678,7 @@ public class PushServiceSocket {
|
|||||||
|
|
||||||
switch (responseCode) {
|
switch (responseCode) {
|
||||||
case 413:
|
case 413:
|
||||||
|
case 429:
|
||||||
throw new RateLimitException("Rate limit exceeded: " + responseCode);
|
throw new RateLimitException("Rate limit exceeded: " + responseCode);
|
||||||
case 401:
|
case 401:
|
||||||
case 403:
|
case 403:
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ public final class DefaultErrorMapper implements ErrorMapper {
|
|||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
case 413:
|
case 413:
|
||||||
|
case 429:
|
||||||
return new RateLimitException("Rate limit exceeded: " + status);
|
return new RateLimitException("Rate limit exceeded: " + status);
|
||||||
case 417:
|
case 417:
|
||||||
return new ExpectationFailedException();
|
return new ExpectationFailedException();
|
||||||
|
|||||||
Reference in New Issue
Block a user