zPeanut / Hydrogen

An open source, mixin based ghost client for Minecraft 1.8.9 built on Minecraft Forge.
MIT License
146 stars 15 forks source link

Exceeding GitHubs Rate Limit #59

Closed Morten-Renner closed 1 year ago

Morten-Renner commented 1 year ago

Describe the bug GitHub is rate limiting its API and responds with 403 to Hydrogens request to https://api.github.com/repos/zpeanut/hydrogen/commits/master

To Reproduce Steps to reproduce the behavior:

  1. Open main menu
  2. click on singe player
  3. go back to main menu
  4. repeat step 2 and 3 ~30 times

Expected behavior Not exceeding the rate limit

Actual behavior Exceeding rate limit

Log

[22:15:22] [Client thread/INFO]: [me.peanut.hydrogen.utils.HTTPUtil:getCurrentCommitHash:27]: java.io.IOException: Server returned HTTP response code: 403 for URL: https://api.github.com/repos/zpeanut/hydrogen/commits/master [22:15:22] [Client thread/INFO]: [me.peanut.hydrogen.utils.HTTPUtil:getCurrentCommitHash:27]: at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1900) [22:15:22] [Client thread/INFO]: [me.peanut.hydrogen.utils.HTTPUtil:getCurrentCommitHash:27]: at sun.net.www.protocol.http.HttpURLConnection.access$200(HttpURLConnection.java:92) [22:15:22] [Client thread/INFO]: [me.peanut.hydrogen.utils.HTTPUtil:getCurrentCommitHash:27]: at sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1490) [22:15:22] [Client thread/INFO]: [me.peanut.hydrogen.utils.HTTPUtil:getCurrentCommitHash:27]: at sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1488) [22:15:22] [Client thread/INFO]: [me.peanut.hydrogen.utils.HTTPUtil:getCurrentCommitHash:27]: at java.security.AccessController.doPrivileged(Native Method) [22:15:22] [Client thread/INFO]: [me.peanut.hydrogen.utils.HTTPUtil:getCurrentCommitHash:27]: at java.security.AccessController.doPrivilegedWithCombiner(AccessController.java:784) [22:15:22] [Client thread/INFO]: [me.peanut.hydrogen.utils.HTTPUtil:getCurrentCommitHash:27]: at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1487) [22:15:22] [Client thread/INFO]: [me.peanut.hydrogen.utils.HTTPUtil:getCurrentCommitHash:27]: at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268) [22:15:22] [Client thread/INFO]: [me.peanut.hydrogen.utils.HTTPUtil:getCurrentCommitHash:27]: at java.net.URL.openStream(URL.java:1067)

GitHub API Response {"message":"API rate limit exceeded for <my ip here>. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"}

Desktop (please complete the following information):