fix: ignore .woff2 and modern static-asset extensions#5
Merged
Merged
Conversation
The static-asset ignore list predates woff2 and other modern web formats. Because matching is suffix-based, '.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 EXTENSIONS_TO_IGNORE, per integration-contract CONTRACT.md section 3 (prerender/integration-contract#1). Also fixes _is_static_asset to lowercase the request path before the suffix check — the contract mandates case-insensitive matching, so '/STYLES.CSS' must pass through like '/styles.css'. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
OpsBeaconCharles
approved these changes
Jun 12, 2026
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.
The bug
The static-asset ignore list (
EXTENSIONS_TO_IGNORE) predates woff2 and other modern web formats. Matching is suffix-based, so.woffdoes not cover.woff2— bot requests for woff2 fonts were proxied to the Prerender service instead of passing through to the origin.On top of that,
_is_static_assetcompared withpath.endswith(ext)without lowercasing the path, while the contract mandates case-insensitive suffix matching —/STYLES.CSSwas incorrectly sent to the rendering service.Live evidence
Verified on prerender.io's own site: Googlebot requesting
inter-*.woff2gets a 504 (normal UA: 200), while.css/.jscorrectly bypass the service.Coordinated propagation
This propagates the canonical contract change from prerender/integration-contract#1, which adds
.woff2 .otf .eot .webp .avif .webmanifestto the static-asset ignore list (CONTRACT.md §3, case-insensitive suffix matching).Changes
prerender_django/middleware.py: added.woff2,.otf,.eot,.webp,.avif,.webmanifesttoEXTENSIONS_TO_IGNOREprerender_django/middleware.py:_is_static_assetnow lowercases the path before the suffix check (extensions are already lowercase)tests/test_middleware.py: addedtest_font_asset_with_bot_ua_passes_through(/fonts/inter.woff2) andtest_uppercase_static_asset_with_bot_ua_passes_through(/STYLES.CSS)Full suite run locally: 13 passed (Python 3.14, pytest, contract mock server fetched per conftest instructions).
🤖 Generated with Claude Code