fix: preview recognized source files served as octet-stream - #3232
fix: preview recognized source files served as octet-stream#3232Creatixpy wants to merge 1 commit into
Conversation
Thanks for opening this pull request! 🎉We really appreciate you taking the time to contribute, @Creatixpy. A maintainer will take a look as soon as they can. In the meantime, please make sure that:
If anything needs adjusting we'll leave comments here. Thanks again! |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughChangesThe code browser now treats Code preview handling
Suggested reviewers: Merge Risk: ⚪ Minimal · up to Recognized source files served as octet-stream now render with syntax highlighting, while unknown and explicit binary files retain binary handling. Bun text lockfiles receive JSONC highlighting without changing bun.lockb fallback behavior, and no merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
Very nice! |
🔗 Linked issue
Fixes #2721
🧭 Context
The code viewer hides recognized source files when jsDelivr serves them as
application/octet-stream. Reproduced withastro-icon@1.1.5/components/Icon.astro: the API already detects Astro and highlights all 138 lines, but the page shows “Binary file”.📚 Description
Use the existing detected language to allow previews for generic octet-stream responses. Unknown files (
text, the language fallback) and specific binary MIME types retain their warning. This follows the approach suggested in the issue without duplicating the extension map.Also recognize the text
bun.lockformat as JSONC.bun.lockbstays unknown/binary. Bump the file-response cache version so previously cached Bun lockfiles receive the new language classification.Validation:
pnpm test:typesandpnpm vp run lintpassed; commit hooks also passed.bun.lock@0.0.0/bun.lockrenders its 28 lines. Both upstream responses still useapplication/octet-stream.Before:
After:
Reviewed with the help of AI.