-
Improvement
-
Resolution: Won't Fix
-
Minor
As GitHub Enterprise does not enforce rate limiting, requests to https://hostname/api/v3/rate_limit will return a 404 Not Found status code.
Based on https://github.com/kohsuke/github-api/blob/d30b0403ceb06c71dc9b099352fb9f03045772aa/src/main/java/org/kohsuke/github/GitHub.java#L257 there is a check, and then the rate limit is set to an arbitrary high number. On very busy systems this results in tens of thousands of requests per hour to the GitHub Enterprise appliance. Although returning a 404 is a relatively simple operation, there are other things such as logging that are impacted by the volume of requests.
A better method would be to look for /api/v3/ within the API URL, and then simply skip the rate limit check altogether. /api/v3/ is unique to GitHub Enterprise, so this will not have any impact on the GitHub.com rate limit endpoint of https://api.github.com/rate_limit