Skip to content

fix: add User-Agent header to Reddit request to resolve 429 error - #81

Merged
Achno merged 1 commit into
Achno:mainfrom
Psylar87:fix/reddit-user-agent
Mar 2, 2026
Merged

Achno merged 1 commit into
Achno:mainfrom
Psylar87:fix/reddit-user-agent

Conversation

@Psylar87

Copy link
Copy Markdown
Contributor

Problem

gowall -w fails with a 429 Too Many Requests error when
fetching 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 -w works after the fix.

Fixes #80

@Psylar87

Psylar87 commented Mar 2, 2026

Copy link
Copy Markdown
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.

@Achno

Achno commented Mar 2, 2026 •

Copy link
Copy Markdown
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 User-Agent request outright.

I'm still extremely confused on how this is macOS specific, though i can't test it because i dont own a mac.
Nevertheless it doesn't hurt to merge it.

@Achno
Achno merged commit 9dad562 into Achno:main Mar 2, 2026
@Psylar87
Psylar87 deleted the fix/reddit-user-agent branch March 2, 2026 17:57
@Psylar87

Psylar87 commented Mar 3, 2026

Copy link
Copy Markdown
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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gowall -w fails with HTTP 429 Too Many Requests when fetching wallpaper of the day

2 participants