Skip to content

v0.4.2

Choose a tag to compare

@cmj0121 cmj0121 released this 28 Apr 14:31
· 118 commits to main since this release

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

  • 7b5a3b1 fix(middleware): classify link-unfurl bots as ModeHTML so OG meta reaches them
  • 552ea89 refactor(middleware): three-bucket UA classifier — CLI ASCII, browser HTML, else PNG
  • 49dee47 refactor(middleware): extract containsAny helper, fold classify into a switch

Full Changelog: v0.4.1...v0.4.2