Skip to content

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

Merged
marcin-prerender merged 1 commit into
mainfrom
fix/ignore-woff2-and-modern-static-assets
Jun 12, 2026
Merged

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

Conversation

@marcin-prerender

Copy link
Copy Markdown
Contributor

The bug

The static-asset ignore list (ExtensionsToIgnore) predates woff2 and other modern web formats. Matching is suffix-based (EndsWith on the lowercased path), so .woff does not cover .woff2 — bot requests for woff2 fonts were proxied to the Prerender service instead of passing through to the origin.

Live evidence

Verified on prerender.io's own site: Googlebot requesting inter-*.woff2 gets a 504 (normal UA: 200), while .css/.js correctly bypass the service.

Coordinated propagation

This propagates the canonical contract change from prerender/integration-contract#1, which adds .woff2 .otf .eot .webp .avif .webmanifest to the static-asset ignore list (CONTRACT.md §3, case-insensitive suffix matching).

Changes

  • PrerenderMiddleware.cs: added .woff2, .otf, .eot, .webp, .avif, .webmanifest to ExtensionsToIgnore. The existing matching (ToLowerInvariant() + EndsWith) is already contract-compliant (case-insensitive suffix) and is unchanged.
  • tests/PrerenderMiddlewareTests.cs: added BotRequest_FontAsset_PassesThrough using /fonts/inter.woff2, mirroring BotRequest_StaticAsset_PassesThrough.

Note: dotnet is not available on the machine that authored this change, so the test suite was not run locally — relying on CI to execute it.

🤖 Generated with Claude Code

The static-asset ignore list predates woff2 and other modern web
formats. Because matching is suffix-based (EndsWith on the lowercased
path), '.woff' does not cover '.woff2', so bot requests for woff2
fonts were proxied to the Prerender service instead of passing
through. Verified live on prerender.io itself: Googlebot requesting
inter-*.woff2 received a 504 while a normal UA received a 200
(.css/.js correctly bypassed).

Adds .woff2, .otf, .eot, .webp, .avif and .webmanifest to
ExtensionsToIgnore, per integration-contract CONTRACT.md section 3
(prerender/integration-contract#1). The existing case-insensitive
suffix matching is already contract-compliant and is kept as is.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@marcin-prerender marcin-prerender merged commit 922bc83 into main Jun 12, 2026
1 check passed
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