Google's oauth2 library doesn't allow the User-Agent header to be set when calling Exchange(). Lacking a User-Agent, Reddit's API frequently returns a HTTP 429 (Too many requests) error. Reddit really wants you to use a custom User-Agent header with every request.
In this PR I used the cryptic instructions from Google in this Github issue to add a User-Agent header to the Exchange() request manually. This is kind of a hack, but Google acknowledges the need for it.
Google's oauth2 library doesn't allow the
User-Agent
header to be set when callingExchange()
. Lacking aUser-Agent
, Reddit's API frequently returns a HTTP 429 (Too many requests) error. Reddit really wants you to use a customUser-Agent
header with every request.In this PR I used the cryptic instructions from Google in this Github issue to add a
User-Agent
header to theExchange()
request manually. This is kind of a hack, but Google acknowledges the need for it.