Google’s Gemini CLI strips stray Authorization headers to fix API-key 401s
loulanyue · ghdev · 2026-07-27
What changed
Google’s gemini-cli fixes a bug where, in GEMINIAPIKEY mode, a leftover Authorization header could override the intended x-goog-api-key auth path and trigger 401 UNAUTHENTICATED ACCESSTOKENTYPEUNSUPPORTED errors on generativelanguage.googleapis.com.
Details
- The patch removes both Authorization and authorization from request headers when using AuthType.USEGEMINI with the default API-key mechanism.
- The change is covered by a unit test in contentGenerator.test.ts.
- The PR reports all tests passing (56 passed).
More from coding & agent
- Hands-on walkthrough shows how AI agents are automating SDLC in 2026 — Pavan_Belagatti · 2026-07-27
- Why Retrieval, Reasoning, and Execution Must Remain Separate AI Layers — Harshit-24 · 2026-07-27
- Watching 10 RPA bots run on Xiaohongshu feels like hearing a baby cry — huangyun_122 · 2026-07-27
- Go SAST triage agent cuts scanner noise, but still needs humans — coldyx · 2026-07-27
- Claude Sonnet SEO workflow hits context bloat on multi-domain SERP JSON — MaTT_fromIT · 2026-07-27
- Builder shares a 17k-memory Claude harness with Postgres retrieval and nightly judging — supermegasaurusrex · 2026-07-27