fix(install): send a default User-Agent with app-source downloads (#2842) - #2846
Conversation
…llstack#2842) api.github.com answers 403 to requests without a User-Agent, so GitHub artifact URLs failed since the transport stopped sending one. Downloads now send 'agent-device' unless the caller sets their own. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Reviewed at 2585edb. The fix itself looks correct: Issue #2842's completion conditions call for a manual install-from-source run against a real GitHub artifact URL, with the command recorded in the PR. The PR body says that run has not been done, and names #2840/#2844 (the direct-download path) as the blocker. That's an honest gap, not a hidden one, but it does mean the acceptance bar in #2842 isn't met yet. A repo-wide grep found only one caller of the provision-kit headers, at https://github.com/callstack/agent-device/blob/2585edb/src/commands/install-source.ts#L127, so the new default should cover every download site, but is that the only place headers get attached for this path, or is there another entry point worth checking? All 13 checks were still queued or in progress when I looked, none failing, and the change stays inside Once #2840/#2844 land, the manual GitHub-artifact install-from-source run from #2842 should be performed and recorded in this PR before merge. |
Summary
api.github.comanswers 403 to requests that carry noUser-Agent. App-source downloads have sent none since #1692, so GitHub artifact URLs fail withFailed to download app source: 403.downloadInstallSourcenow sendsuser-agent: agent-deviceby default. A caller header replaces it in any letter case (for example--header "User-Agent:my-ci"). The default survives cross-origin redirects becausecrossOriginHeadersalready keepsuser-agent.2 files touched (source + its colocated test). No scope expansion.
Closes #2842
Validation
Tested at
2585edbc9:user-agent: agent-device, and a caller'sUser-Agentreplaces it instead of being joined by a second one. Removing the default fails the first assertion.pnpm check:affected --run: all runnable checks passed (358 files, 2255 tests).Remaining risk: no manual
install-from-sourcerun against a GitHub artifact URL. It needs #2840 (#2844) for the direct download path. The repo's own artifacts hold logs, not an installable APK or .app, so I had nothing to install. Command to verify once #2844 lands:🤖 Generated with Claude Code