Repository navigation
fix: add User-Agent header to Reddit request to resolve 429 error - #81
Merged
Merged
Conversation
Contributor
Author
|
While this issue appears to be macOS-specific, it has been tested on both Linux and macOS to confirm the fix does not cause any issues on either platform. |
Owner
|
I have tested this on Linux and it works fine. The previous version without the user agent works just fine on both Linux and Windows as well as a lot of other linux machines and VM'S. Reddit doesn't block every non I'm still extremely confused on how this is macOS specific, though i can't test it because i dont own a mac. |
Contributor
Author
|
I do have a Mac, and I’m still a bit confused about why this issue seems to only affect macOS. It might be related to how HTTP requests are handled differently? I don’t know. Thank you for the merge! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
gowall -wfails with a 429 Too Many Requests error whenfetching the wallpaper of the day.
Root Cause
http.Get() sends no User-Agent header. Reddit blocks requests
that don't identify themselves, treating them as bots.
Fix
Replaced http.Get() with a manual request that includes a
browser-like User-Agent header.
Testing
Verified with curl that the User-Agent was the root cause.
Built from source and confirmed
gowall -wworks after the fix.Fixes #80