Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/web/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ export async function proxy(request: NextRequest) {
path.startsWith("/invite") ||
path.startsWith("/self-hosting") ||
path.startsWith("/terms") ||
path.startsWith("/verify-otp")
path.startsWith("/verify-otp") ||
path.startsWith("/embed/") ||
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

path.startsWith("/.well-known/")
) &&
process.env.NODE_ENV !== "development"
)
Expand Down