v0.4.2
What's Changed
Fixes empty link previews on Telegram, Slack, Twitter, Facebook, Discord, LinkedIn, WhatsApp, Line, and other chat platforms by reworking the User-Agent classifier into a three-bucket model.
Three-bucket UA classification
| User-Agent | Response |
|---|---|
| CLI / scripting (curl, wget, HTTPie, go-http-client, python-requests, libwww, okhttp, java/, powershell) | ASCII plain text |
| Real browser (Mozilla in UA, not also a known unfurl bot) | HTML page with embedded SVG + OG meta |
| Everything else: unfurl bots (TelegramBot, Slackbot, Twitterbot, facebookexternalhit, Discordbot, LinkedInBot, WhatsApp, Line, …), unknown clients, empty UA | PNG image |
Previously bots fell into the ASCII bucket and got plain text with no og:image to render — the link preview collapsed to a bare URL. Now they get a usable PNG directly.
Bots that fake "Mozilla" in their UA (Discordbot, LinkedInBot, Applebot) are detected before the Mozilla → HTML branch so they land on PNG with the rest.
Commits
7b5a3b1fix(middleware): classify link-unfurl bots as ModeHTML so OG meta reaches them552ea89refactor(middleware): three-bucket UA classifier — CLI ASCII, browser HTML, else PNG49dee47refactor(middleware): extract containsAny helper, fold classify into a switch
Full Changelog: v0.4.1...v0.4.2