mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #10784 from overleaf/jk-gitbridge-add-rate-limits
[git-bridge] Add rate-limits on GitBridgeRouter GitOrigin-RevId: ec935fae39cc061cefe3c932304de8cde2fdd185
This commit is contained in:
parent
bed2596468
commit
7c1e91573c
1 changed files with 7 additions and 0 deletions
|
@ -76,6 +76,13 @@ public abstract class Request<T extends Result> {
|
|||
int sc = httpCause.getStatusCode();
|
||||
if (sc == HttpServletResponse.SC_UNAUTHORIZED || sc == HttpServletResponse.SC_FORBIDDEN) { // 401, 403
|
||||
throw new ForbiddenException();
|
||||
} else if (sc == 429) { // Too many requests
|
||||
throw new MissingRepositoryException(Arrays.asList(
|
||||
"Rate-limit exceeded. Please wait a while and try again.",
|
||||
"",
|
||||
"If this is unexpected, please contact us at support@overleaf.com, or",
|
||||
"see https://www.overleaf.com/help/342 for more information."
|
||||
));
|
||||
} else if (sc == HttpServletResponse.SC_CONFLICT) { // 409
|
||||
try {
|
||||
JsonObject json = Instance.gson.fromJson(httpCause.getContent(), JsonObject.class);
|
||||
|
|
Loading…
Reference in a new issue