Skip to content

Fix: accept the configured web host in share URL parsing - #2574

Closed
dangzhuotong wants to merge 1 commit into
CapSoftware:mainfrom
dangzhuotong:cursor/self-hosted-share-unfurl-b68c
Closed

dangzhuotong wants to merge 1 commit into
CapSoftware:mainfrom
dangzhuotong:cursor/self-hosted-share-unfurl-b68c

Conversation

@dangzhuotong

@dangzhuotong dangzhuotong commented Oct 14, 2026 •

Copy link
Copy Markdown

Summary

Fixes #2546 — self-hosted Cap never Slack-unfurls (or oEmbeds) share links on the server's own domain because parseCapShareUrl only accepted cap.so / cap.link.

This change also accepts the host of WEB_URL for the /s/<id> path (lowercase, optional leading www. stripped). Hosted cap.so and cap.link behavior is unchanged. Invalid/missing WEB_URL does not break hosted domains.

Self-test

Unit: apps/web/__tests__/unit/oembed.test.ts, slack-unfurl.test.ts, share-video-metadata.test.ts (34 tests) passed; Biome clean on touched files.

Quick check without Slack (expect 200 + oEmbed JSON on self-hosted):

curl -s -o /dev/null -w "%{http_code}\n" \
  "https://<WEB_URL host>/api/oembed?url=https%3A%2F%2F<WEB_URL host>%2Fs%2F<id>&format=json"

Author

卓橦 (Zhuotong) / @dangzhuotong

RetriggerConfidence Score: 5/5

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

Summary

parseCapShareUrl now accepts /s/<id> links on the configured WEB_URL hostname.

  • Self-hosted share links now work with oEmbed and Slack unfurls.

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

Self-hosted Slack unfurls and /api/oembed dropped /s/<id> links because
parseCapShareUrl only allowed cap.so and cap.link.

Fixes CapSoftware#2546

Co-authored-by: 卓橦 <dangzhuotong@users.noreply.github.com>
@vercel

vercel Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

@dangzhuotong is attempting to deploy a commit to the Cap Software Inc Team on Vercel.

A member of the Team first needs to authorize it.

@richiemcilroy

Copy link
Copy Markdown
Member

Thanks for the PR. Closing this as a duplicate: #2549 fixed the same issue (#2546) and has been merged, so share URLs on the configured web host now parse on main. Cheers!

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