Repository navigation
Conversation
- Fix Content-Type header casing in apiPost(): `getJsonHeadersAsync` sets lowercase `content-type`, but apiPost was setting `Content-Type` (title case), resulting in duplicate headers that caused Twitter to reject all REST POST requests (follow, unfollow, tweet, like, etc.) with 403. - Update x-client-transaction-id from 0.1.9 to 0.2.0 to fix transaction ID generation (KEY_BYTE indices error). - Refresh all GraphQL query IDs scraped from Twitter's current JS bundle (main.cbf7085a.js, March 2026). - Improve follow() resilience: don't throw on REST error code 108 (which Twitter now returns as a generic rejection), fall through to GraphQL fallback instead. Add standard Twitter API parameters to follow request body to match web client behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Content-Typeheader casing inapiPost()—getJsonHeadersAsync()sets lowercasecontent-type: application/json, butapiPost()was settingContent-Type(title case) to override it. JavaScript objects are case-sensitive, so both headers were sent simultaneously, causing Twitter to reject all REST POST requests (follow, unfollow, tweet, like, retweet, bookmark, etc.) with HTTP 403.x-client-transaction-idfrom 0.1.9 → 0.2.0 to fix transaction ID generation (KEY_BYTE indiceserror)main.cbf7085a.js, March 2026) — 20+ stale IDs updatedfollow()resilience — don't short-circuit on REST error code 108 (Twitter now returns this as a generic rejection for deprecated auth patterns); fall through to GraphQL fallback instead. Added standard API parameters to match web client behavior.What was broken
All REST POST mutations (follow, unfollow, tweet, reply, like, retweet, bookmark) were silently failing due to the duplicate
Content-Type/content-typeheader. GraphQL reads also failed due to stale query IDs.Test plan
bird whoami— auth checkbird home— home timelinebird search "AI agents"— searchbird user-tweets @sama— user tweetsbird about @drfeifei— user lookupbird following— following listbird trending— trending topicsbird follow @shanselman— follow userbird unfollow @techgirl1908— unfollow user🤖 Generated with Claude Code