Skip to content

Calls based on roundTripWithOptionalFollowRedirect do not respect rate limits #3406

@wmouchere

Description

@wmouchere

Hi,
I am using go-github to pull logs from Github Actions logs and recently had issues with ratelimits on that endpoint, leading to IP blacklisting by GitHub (confirmed with the support).

There are multiple examples of exported methods that do not respect rate limit headers returned by GitHub (e.g. GetWorkflowJobLogs, DownloadArtifact, ...).

The root cause of this problem is that some endpoint of the GitHub API return a 302 code for success response (like GetWorkflowJobLogs).

Because go's http.Client automatically follows 3xx's by default, the library currently chooses to use the lower level RoundTripper to execute the API call instead, leaving out all the API sugar that is usually wrapping calls to http.Client in BaseDo.

Am I understanding this issue correctly? I have a contribution ready if that's the case to refactor the client to support not following 3xx's on some endpoint


cc @rpelliard @Letiste

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions