Skip to content

Fix 403 game lookups by not reusing cached client User-Agent (#89) - #97

Merged
misantronic merged 1 commit into
mainfrom
fix/89-proxy-self-user-agent
Aug 10, 2026
Merged

Fix 403 game lookups by not reusing cached client User-Agent (#89)#97
misantronic merged 1 commit into
mainfrom
fix/89-proxy-self-user-agent

Conversation

@misantronic

Copy link
Copy Markdown
Owner

Fixes #89.

Problem

The proxy identified itself to RetroAchievements with ua::last — the User-Agent of whichever emulator most recently passed through it. RA reads the first token of the User-Agent as the client identity and answers blocked clients with 403 unsupported_client on every endpoint, including r=gameid.

So one emulator RA rejects poisoned every request the proxy made on its own behalf, for every console. The reporter's Game Boy folder scan failed because a GameCube emulator's identity was cached. ua::last is exempt from cache eviction, so it never expired.

Worth noting: RA sets clientVersion = 'Unknown' when it can't parse a version out of the User-Agent, and that sorts below every minimum, so a current build with a versionless UA is rejected exactly like an ancient one.

Fix

New self_user_agent() used for every request the proxy originates — manual ROM caching, preview images, the reachability probe, and the background refresher. Genuinely forwarded emulator requests still carry the client's real User-Agent via build_forward_headers, and pending awards still replay under the User-Agent that earned them.

Storage.load_user_agent is removed; it existed only to feed this bug.

Diagnostics

http_get was discarding RA's response body, so the only thing that ever surfaced was HTTP Error 403: Forbidden. It now extracts RA's own Code/Error and logs the outgoing User-Agent:

before: GET failed status=403 reason=Forbidden url=...
after:  GET failed status=403 reason=unsupported_client: This client is not supported. ua=... url=...

Verification

Confirmed against the live RA API using the exact hash from the report:

RetroArch/1.21.0 (Linux) RAOfflineProxy/Linux/...  ->  {"Success":true,"GameID":504}
Dolphin/2407 RAOfflineProxy/Linux/...              ->  403 unsupported_client

Reporter confirmed the test build resolves the issue on ROCKNIX.

Existing installs self-heal on upgrade — the poisoned row is simply no longer read.

Notes

  • PROXY_UA_TAG now derives from APP_VERSION instead of being a second hardcoded copy that had drifted.
  • APP_VERSION is bumped to 1.10.0-alpha7. It is shared by the muOS, Knulli and Onion bundles, whose own build scripts still default to alpha2 filenames.
  • Android has the same defect (RomScanner.kt, MainViewModel.kt, AwardFlusher.kt, ProxyService.kt) and is not addressed here.

@misantronic
misantronic merged commit e8853dc into main Aug 10, 2026
2 checks passed
@misantronic
misantronic deleted the fix/89-proxy-self-user-agent branch August 10, 2026 17:38
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.

Game lookup failed: HTTP Error 403: Forbidden

1 participant