Skip to content

fix: Add custom User-Agent header to Scryfall client#35

Open
rsierra wants to merge 1 commit into
OliverHofkens:masterfrom
rsierra:fix-scryfall-headers
Open

fix: Add custom User-Agent header to Scryfall client#35
rsierra wants to merge 1 commit into
OliverHofkens:masterfrom
rsierra:fix-scryfall-headers

Conversation

@rsierra

@rsierra rsierra commented Jun 12, 2026

Copy link
Copy Markdown

Description

Scryfall's API recently started rejecting HTTP requests that use default library User-Agent strings (such as python-requests/x.y.z), returning a 400 Bad Request with subcode: generic_user_agent. This was causing the bot to fail completely when querying the API.

This PR adds a custom User-Agent header (ScryfallTelegramBot/2.6.0 (+https://github.com/OliverHofkens/scryfall-telegram)) to the requests.Session in ScryfallClient.

Testing

  • Ran local unit and integration tests under tests/ which now pass successfully.
  • Manually verified that Scryfall API no longer returns 400 errors when using the custom User-Agent.

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.

1 participant