Skip to content

Commit

Permalink
Fix secondary rate limits URL (#3001)
Browse files Browse the repository at this point in the history
  • Loading branch information
Letiste committed Nov 27, 2023
1 parent 942692e commit 182859f
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 @@ -1133,7 +1133,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 @@ -1259,7 +1259,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 182859f

Please sign in to comment.