fix: ignore font and modern static-asset extensions#71
Open
marcin-prerender wants to merge 1 commit into
Open
Conversation
Add .ttf, .otf, .woff, .woff2, .eot, .svg, .webp, .avif and .webmanifest to @extensions_to_ignore and remove the duplicated .doc entry. The list previously ended at .torrent, so no font, SVG or modern image format was filtered at all: every bot request for such an asset was forwarded to the Prerender service, which rejects static assets with 504. Verified live that Googlebot requesting prerender.io's own inter-*.woff2 receives a 504 (a normal UA gets 200), so these forwarded requests surface as crawler-visible 5xx. Aligns with the canonical static-asset ignore list in prerender/integration-contract#1. 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.
Bug
@extensions_to_ignoreends at.torrent— there is no font, SVG, or modern image filtering at all. Every bot request for a.woff2/.ttf/.svg/.webp/etc. asset is forwarded to the Prerender service, which rejects static-asset URLs with 504. The result is a crawler-visible 5xx for every font/image a bot fetches through the middleware.Live evidence
Verified against prerender.io's own assets: requesting
inter-*.woff2with a Googlebot user agent returns 504, while a normal browser UA returns 200.Canonical contract
This aligns the middleware with the canonical static-asset ignore list, which now includes
.woff2 .otf .eot .webp .avif .webmanifest: prerender/integration-contract#1Changes
lib/prerender_rails.rb: add.ttf .otf .woff .woff2 .eot .svg .webp .avif .webmanifestto@extensions_to_ignore; remove the duplicated.docentry.test/lib/prerender_rails.rb: add a test mirroring the existing resource-file test for a font request (/fonts/inter.woff2) asserting the request continues to the app instead of being proxied.Matching semantics are deliberately left as-is: the check is
request.fullpath.include?(extension)— a case-sensitive substring match over path and query string. Side note: this already over-matches today (e.g..aimatches any URL containing.ai, such asexample.aidomains in query params, and/blog/what-is-a-pdfis unaffected but?file=x.pdfis filtered); tightening that to a real extension check is out of scope for this PR.Tests
bundle install && ruby -Ilib test/lib/prerender_rails.rb(Ruby 2.6.10, Bundler 2.1.4;RUBYOPT=-rloggerto work around the unrelated concurrent-ruby 1.3.5 / ActiveSupport 6.1Loggerautoload issue): 28 runs, 36 assertions, 0 failures, 0 errors, including the new font test.🤖 Generated with Claude Code