Skip to content

fix: accept the configured web host in share URL parsing - #2549

Merged
richiemcilroy merged 1 commit into
CapSoftware:mainfrom
mangeshraut712:fix/self-hosted-share-url-unfurl
Oct 14, 2026
Merged

richiemcilroy merged 1 commit into
CapSoftware:mainfrom
mangeshraut712:fix/self-hosted-share-url-unfurl

Conversation

@mangeshraut712

@mangeshraut712 mangeshraut712 commented Oct 14, 2026 •

Copy link
Copy Markdown

Self-hosted share links never unfurled. parseCapShareUrl only accepted cap.so/s/<id> and cap.link/<id>, so a link like https://video.example.com/s/<id> returned null. Slack skipped chat.unfurl, and /api/oembed returned 400.

parseCapShareUrl now also accepts the host from serverEnv().WEB_URL, lowercased with a leading www. removed, for the /s/<id> shape. cap.so and cap.link stay the same. Other hosts and http:// still return null. The Slack handler and /api/oembed already call this function, so both pick up the configured host.

apps/web Vitest only runs __tests__/**/*.test.ts, so the regression tests are in apps/web/__tests__/unit/oembed.test.ts, with a Slack caller check in slack-unfurl.test.ts.

I reproduced the null on current main and saw the new test fail before the fix. Afterward, bun run --cwd apps/web test -- __tests__/unit/oembed.test.ts __tests__/unit/slack-unfurl.test.ts __tests__/unit/share-video-metadata.test.ts passed, bun run biome check was clean on the touched files, and bun run typecheck passed. bun run lint still fails on existing issues outside this change.

Fixes #2546

RetriggerConfidence Score: 5/5

This PR appears safe to merge; no actionable issues were found.

Summary

parseCapShareUrl now accepts HTTPS /s/<id> links on the host configured by WEB_URL.

  • Self-hosted share links now parse for embeds and Slack unfurls.

Reviews (1) · Last reviewed commit: "fix: accept the configured web host in s..." · Reviewed by Greptile

Self-hosted /s/<id> links were dropped because parseCapShareUrl only
matched cap.so and cap.link, so Slack never unfurled them and oEmbed
returned 400.
@vercel

vercel Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
cap-status Skipped Skipped Oct 14, 2026 4:26am UTC

@vercel
vercel Bot temporarily deployed to Preview – cap-status October 14, 2026 04:26 Inactive
@richiemcilroy

Copy link
Copy Markdown
Member

Thanks for the PR!

@richiemcilroy
richiemcilroy merged commit 5942365 into CapSoftware:main Oct 14, 2026
19 of 20 checks passed

This branch was previously deployed

1 inactive deployment
Preview – cap-status — 84fda454 Deployed Oct 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slack integration: links on self-hosted domains never unfurl (parseCapShareUrl only accepts cap.so / cap.link)

2 participants