Repository navigation
fix: accept the configured web host in share URL parsing - #2549
Merged
richiemcilroy merged 1 commit intoOct 14, 2026
Merged
richiemcilroy merged 1 commit into
richiemcilroy merged 1 commit into
Conversation
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.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Member
|
Thanks for the PR! |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Self-hosted share links never unfurled.
parseCapShareUrlonly acceptedcap.so/s/<id>andcap.link/<id>, so a link likehttps://video.example.com/s/<id>returned null. Slack skippedchat.unfurl, and/api/oembedreturned 400.parseCapShareUrlnow also accepts the host fromserverEnv().WEB_URL, lowercased with a leadingwww.removed, for the/s/<id>shape.cap.soandcap.linkstay the same. Other hosts andhttp://still return null. The Slack handler and/api/oembedalready call this function, so both pick up the configured host.apps/web Vitest only runs
__tests__/**/*.test.ts, so the regression tests are inapps/web/__tests__/unit/oembed.test.ts, with a Slack caller check inslack-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.tspassed,bun run biome checkwas clean on the touched files, andbun run typecheckpassed.bun run lintstill fails on existing issues outside this change.Fixes #2546

Confidence Score: 5/5
This PR appears safe to merge; no actionable issues were found.Summary
parseCapShareUrlnow accepts HTTPS/s/<id>links on the host configured byWEB_URL.Reviews (1) · Last reviewed commit: "fix: accept the configured web host in s..." · Reviewed by Greptile