fix: exclude static assets from markdown edge function#176
Merged
Conversation
Prevents 500 errors on JS, CSS, fonts, and images by skipping markdown processing for static assets. The edge function was incorrectly attempting to serve markdown versions of asset files when browsers sent Accept: text/plain headers. Fixes static asset loading failures causing: - autocomplete-js.js 500 errors - site.js and site.css 500 errors - Font files (Inter, IBM Plex Mono) 500 errors - SVG and image 500 errors Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
✅ Deploy Preview for redpanda-documentation ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
micheleRP
approved these changes
May 18, 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.

Summary
Fixes 500 errors on all static assets (JS, CSS, fonts, SVGs) caused by the serve-markdown edge function incorrectly processing asset requests.
Root Cause
The
serve-markdown.jsedge function runs on/*(all paths) to enable markdown content negotiation. However, when browsers sentAccept: text/plainheaders for static assets, the edge function attempted to process them as markdown files, causing:/assets/js/site.js→/assets/js/site.js/index.mdChanges
serve-markdown.js:
.js,.css,.woff,.ttf,.svg,.png,.jpg,.json, etc.Impact
Before: All static assets return 500 errors, completely breaking site functionality
After: Static assets load correctly with 200 status codes while markdown content negotiation continues to work for documentation pages
Testing
Accept: text/markdownFixes the 500 errors reported on autocomplete-js.js, site.js, site.css, Inter fonts, IBM Plex Mono fonts, and SVG icons.
🤖 Generated with Claude Code