Skip to content

Commit

Permalink
Fix secondary rate limits URL (google#3001)
Browse files Browse the repository at this point in the history
  • Loading branch information
Letiste authored and gmlewis committed Dec 19, 2023
1 parent 76779c0 commit baf2515
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ func (ae *AcceptedError) Is(target error) bool {
}

// AbuseRateLimitError occurs when GitHub returns 403 Forbidden response with the
// "documentation_url" field value equal to "https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits".
// "documentation_url" field value equal to "https://docs.github.com/rest/overview/rate-limits-for-the-rest-api#about-secondary-rate-limits".
type AbuseRateLimitError struct {
Response *http.Response // HTTP response that caused this error
Message string `json:"message"` // error message
Expand Down Expand Up @@ -1261,7 +1261,7 @@ func CheckResponse(r *http.Response) error {
}
case r.StatusCode == http.StatusForbidden &&
(strings.HasSuffix(errorResponse.DocumentationURL, "#abuse-rate-limits") ||
strings.HasSuffix(errorResponse.DocumentationURL, "#secondary-rate-limits")):
strings.HasSuffix(errorResponse.DocumentationURL, "secondary-rate-limits")):
abuseRateLimitError := &AbuseRateLimitError{
Response: errorResponse.Response,
Message: errorResponse.Message,
Expand Down

0 comments on commit baf2515

Please sign in to comment.