Skip to content

fix: ignore .woff2 and modern static-asset extensions#4

Open
marcin-prerender wants to merge 1 commit into
prerender:mainfrom
marcin-prerender:fix/ignore-woff2-and-modern-static-assets
Open

fix: ignore .woff2 and modern static-asset extensions#4
marcin-prerender wants to merge 1 commit into
prerender:mainfrom
marcin-prerender:fix/ignore-woff2-and-modern-static-assets

Conversation

@marcin-prerender

Copy link
Copy Markdown

The bug

Both workers' IGNORE_EXTENSIONS blocklists predate woff2. The filter does exact, case-insensitive matching on the final extension, so .woff does not cover .woff2. Bot requests for .woff2 (and .otf, .eot, .webp, .avif) fonts/images were therefore routed to service.prerender.io instead of being served directly — wasting renders and breaking asset delivery for crawlers.

Live evidence

Verified against prerender.io itself: a Googlebot-UA request for inter-*.woff2 returns a 504 (normal UA: 200), while .css/.js correctly bypass Prerender and return 200 for both UAs.

Contract

Canonical change to the static-asset ignore list: prerender/integration-contract#1 — the contract list (case-insensitive suffix matching) now includes .woff2 .otf .eot .webp .avif .webmanifest.

Changes

  • worker-subscriber.js: added .woff2, .otf, .eot, .webp, .avif to IGNORE_EXTENSIONS; removed the duplicate .doc entry (.webmanifest was already present).
  • worker-custom-domain.js: added the same five extensions.

No logic changes; both workers already lowercase the pathname/extension before comparison. Validated with node --check.

🤖 Generated with Claude Code

The IGNORE_EXTENSIONS blocklists predate woff2. Suffix matching is
exact on the final extension, so ".woff" does not cover ".woff2" —
verified live: Googlebot requesting prerender.io's own inter-*.woff2
got a 504 (normal UA: 200) while .css/.js correctly bypassed.

Adds .woff2, .otf, .eot, .webp, .avif to both workers per the
integration contract (prerender/integration-contract#1), and removes
the duplicate ".doc" entry in worker-subscriber.js.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

2 participants