this repo has no description
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(share): trailing slash so Bluesky composer treats handle URLs as HTML

Root cause: bluesky-social/social-app classifies pasted URLs with a
client-side `getLikelyType` BEFORE calling Cardyb. It splits the URL
path by `.`, takes the last segment, and looks it up in a baked-in
MIME-type table. For atproto handles like `foo.com` the segment is
`com`, mapped to `application/x-msdownload` (a Windows executable).
The composer therefore returns LikelyType.Other, never calls Cardyb,
and shows a link card without an image.

Source:
https://github.com/bluesky-social/social-app/blob/main/src/lib/link-meta/link-meta.ts

Fix: append `/` to project page share URLs. The composer now sees
extension `com/`, falls through to LikelyType.HTML, calls Cardyb
extract, and unfurls the page (Cardyb follows our 308 to the
canonical no-slash URL and reads the OG meta tags as expected).

This is purely a share-URL change; the canonical Fresh route stays
at `/explore/[handle]`, and `/explore/[handle]/` continues to 308.

Made-with: Cursor

+23 -2
+17 -1
routes/explore/[handle].tsx
··· 72 72 [] as ProfileUpdateRow[], 73 73 ]; 74 74 const displayReviews = profile ? await enrichReviews(reviews) : []; 75 + /** 76 + * Share URL intentionally ends in `/`. Bluesky's composer runs a 77 + * client-side `getLikelyType` over the pasted URL: it splits the path 78 + * by `.`, takes the last segment, and looks it up in a MIME-type 79 + * table. For handles like `foo.com` the "extension" is `com`, mapped 80 + * to `application/x-msdownload` (a Windows executable!), so the 81 + * composer treats the URL as a non-HTML resource and refuses to call 82 + * Cardyb at all — the link card has no preview image. Adding the 83 + * trailing slash makes the parsed extension `com/`, which is not in 84 + * the table, so the composer falls through to its `LikelyType.HTML` 85 + * default and unfurls the page. Cardyb / our redirect middleware 86 + * round-trip to the canonical no-slash URL, so the post link still 87 + * resolves correctly. 88 + * 89 + * Bluesky source: https://github.com/bluesky-social/social-app/blob/main/src/lib/link-meta/link-meta.ts 90 + */ 75 91 const shareUrl = profile 76 92 ? new URL( 77 - `/explore/${encodeURIComponent(profile.handle)}`, 93 + `/explore/${encodeURIComponent(profile.handle)}/`, 78 94 ctx.url.origin, 79 95 ).href 80 96 : ctx.url.href;
+6 -1
routes/explore/manage.tsx
··· 140 140 : null; 141 141 142 142 const publicProfileHandle = takedown ? null : existing?.handle ?? null; 143 + /** 144 + * Trailing slash is intentional — see the long comment in 145 + * routes/explore/[handle].tsx. Bluesky's composer otherwise treats 146 + * `/explore/foo.com` as a Windows executable and skips the unfurl. 147 + */ 143 148 const shareUrl = publicProfileHandle 144 149 ? new URL( 145 - `/explore/${encodeURIComponent(publicProfileHandle)}`, 150 + `/explore/${encodeURIComponent(publicProfileHandle)}/`, 146 151 ctx.url.origin, 147 152 ).href 148 153 : null;