fix: allow /embed/ and /.well-known/ routes on self-hosted instances#1802
Open
bskthefirst wants to merge 1 commit into
Open
fix: allow /embed/ and /.well-known/ routes on self-hosted instances#1802bskthefirst wants to merge 1 commit into
bskthefirst wants to merge 1 commit into
Conversation
- Prevents proxy from redirecting /embed/* and /.well-known/* to /login on non-cap.so deployments (self-hosted) - Fixes CapSoftware#1768 and CapSoftware#1774 This fix was generated with AI assistance (Codex/Hermes) and manually reviewed.
| path.startsWith("/terms") || | ||
| path.startsWith("/verify-otp") | ||
| path.startsWith("/verify-otp") || | ||
| path.startsWith("/embed/") || |
Contributor
There was a problem hiding this comment.
Trailing-slash mismatch on
/embed/
The check uses path.startsWith("/embed/") (with a trailing slash), so a request to /embed (no trailing slash) would still be redirected to /login. All other "section" entries in this whitelist (e.g. /dashboard, /onboarding, /terms) omit the trailing slash and match both the root path and any sub-paths. To be consistent and safe, consider dropping the trailing slash so it reads path.startsWith("/embed").
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/web/proxy.ts
Line: 53
Comment:
**Trailing-slash mismatch on `/embed/`**
The check uses `path.startsWith("/embed/")` (with a trailing slash), so a request to `/embed` (no trailing slash) would still be redirected to `/login`. All other "section" entries in this whitelist (e.g. `/dashboard`, `/onboarding`, `/terms`) omit the trailing slash and match both the root path and any sub-paths. To be consistent and safe, consider dropping the trailing slash so it reads `path.startsWith("/embed")`.
How can I resolve this? If you propose a fix, please make it concise.
This was referenced May 12, 2026
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.
Summary
Self-hosted instances currently redirect /embed/* and /.well-known/* requests to /login because the proxy whitelist does not include these paths.
Changes
Issues Fixed
Notes
Test Plan
Greptile Summary
This PR adds
/embed/and/.well-known/to the self-hosted proxy whitelist inapps/web/proxy.ts, fixing two issues where those routes were incorrectly redirected to/loginon self-hosted instances./embed/is now whitelisted so embedded video pages load correctly without an auth redirect on self-hosted deployments./.well-known/is now whitelisted, enabling ACME challenges, OpenID Connect discovery, and similar standard discovery paths to function as expected.Confidence Score: 4/5
Safe to merge — the change is small and targeted, only affecting the self-hosted path whitelist with no impact on the main Cap cloud deployment.
The fix is correct and well-scoped. The only minor inconsistency is that
/embed/is whitelisted with a trailing slash while all other entries in the same list use no trailing slash, which means a bare/embedrequest would still redirect to/login. This is unlikely to matter in practice but is worth aligning with the surrounding pattern.Only
apps/web/proxy.tschanged — a quick check on the trailing-slash consistency on line 53 is worthwhile.Important Files Changed
/embed/and/.well-known/to the self-hosted proxy whitelist so those routes are no longer redirected to/loginon self-hosted instances. The logic change is minimal and correct, though/embedwithout the trailing slash remains blocked.Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "fix: allow /embed/ and /.well-known/ rou..." | Re-trigger Greptile