Send User-Agent on schedule fetches to avoid Akamai 403 - #225
Closed
gerber55555 wants to merge 1 commit into
Closed
Conversation
site.api.espn.com (the per-team schedule host used by the Upcoming Games feature) sits behind Akamai bot protection that now rejects requests without a User-Agent header — Node's fetch sends none by default, so every getTeamSchedule call returned 403 and the Upcoming Games section silently rendered empty. Spoofed browser UAs are also rejected (TLS fingerprint mismatch); an honest non-browser UA passes. The scoreboard host (site.web.api.espn.com) is different infrastructure and unaffected, which is why live scores kept working. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Owner
|
I had the same issue with MyStandings. This module was working for me, so I didn’t mess with it. But I’m unsurprised it popped up here too. Will review and merge. |
Author
Yea it's only with the upcoming games (schedule), the live scoreboard uses a different endpoint so it doesn't have that issue. |
Owner
|
Fixed with #226 |
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.
Problem
The Upcoming Games section silently renders empty for some users. The per-team schedule endpoint (
site.api.espn.com, Akamai edge) now returns 403 for requests without aUser-Agentheader — Node'sfetchsends none by default. EverygetTeamSchedulecall fails, the error is caught, andnullis cached per team, so the section just shows nothing.Notes from debugging on a Raspberry Pi:
curl/7.74.0,MMM-MyScoreboard (...)) → 200site.web.api.espn.com) is different infrastructure and unaffected — live scores keep working, which makes this failure easy to missFix
Send an honest module User-Agent on schedule fetches:
Also extends the fetch mock to record request init (fixing an unrelated latent bug where the
setErrorwrapper dropped the init argument) and adds a regression test asserting the header is sent.Testing
🤖 Generated with Claude Code