Skip to content

Commit 1a48b63

Browse files
authored
Merge pull request #99 from ConductorOne/jallers/tweak-ratelimit
Distinguish between 403 rate limit vs permission error
2 parents 092c0c9 + ecea3a0 commit 1a48b63

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/connector/helpers.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,5 +230,8 @@ func isRatelimited(resp *github.Response) bool {
230230
if resp == nil {
231231
return false
232232
}
233-
return resp.StatusCode == http.StatusForbidden || resp.StatusCode == http.StatusTooManyRequests
233+
if resp.Header.Get("X-Ratelimit-Remaining") == "0" {
234+
return true
235+
}
236+
return resp.StatusCode == http.StatusTooManyRequests
234237
}

0 commit comments

Comments
 (0)