fix: ignore .woff2 and modern static-asset extensions#3
Merged
marcin-prerender merged 1 commit intoJun 12, 2026
Conversation
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 middleware.js and proxy.ts per the integration contract (prerender/integration-contract#1), and removes the duplicate ".doc" entry in middleware.js. Also fixes two filter bugs: - proxy.ts: the extension filter was dead code. The extracted extension already includes the leading dot (".woff"), but the code prefixed another dot ("..woff"), which never matched IGNORE_EXTENSIONS — so ALL bot static-asset requests were forwarded to Prerender. Now compares the extracted extension directly, lowercased. - middleware.js: the extension was compared case-sensitively; the contract mandates case-insensitive suffix matching. Now lowercased before the includes check. 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 bugs
1. Missing modern static-asset extensions. The
IGNORE_EXTENSIONSblocklists predate woff2. Matching is exact on the final extension, so.woffdoes not cover.woff2. Bot requests for.woff2/.otf/.eot/.webp/.avifassets were routed toservice.prerender.ioinstead of being served directly.2.
proxy.ts: the extension filter was dead code — it matched NOTHING. The extractionalready yields the extension with its leading dot (e.g.
".woff";""for dotless paths). The code then prefixed another dot:"..woff"never matches anyIGNORE_EXTENSIONSentry, so every bot static-asset request (.css,.js, images, fonts — all of them) was forwarded to Prerender in theproxy.tsintegration.3.
middleware.js: case-sensitive comparison. The extracted extension was compared without lowercasing, so e.g./LOGO.PNGslipped past the filter. The contract mandates case-insensitive suffix matching.Live evidence
Verified against prerender.io itself: a Googlebot-UA request for
inter-*.woff2returns a 504 (normal UA: 200), while.css/.jscorrectly 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
middleware.js: added.woff2,.otf,.eot,.webp,.aviftoIGNORE_EXTENSIONS; removed the duplicate.doc; extension is now lowercased before theincludescheck.proxy.ts: added the same five extensions; removed the broken double-dotdottedExtconstruction — the comparison now uses the extracted extension directly (it already includes the leading dot), lowercased. Dotless paths still yield"", which never matches.Validated
middleware.jswithnode --check; sanity-tested the extraction (/fonts/inter-bold.WOFF2→.woff2→ ignored;/about→""→ proxied).🤖 Generated with Claude Code