fix(shortlink): remove isHosted guard from redirects, not available at build time on ECS#3251
Merged
waleedlatif1 merged 2 commits intostagingfrom Feb 18, 2026
Merged
Conversation
…t build time on ECS
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Collaborator
Author
|
@greptile |
Collaborator
Author
|
@cursor review |
Contributor
Greptile SummaryThis PR fixes a bug where the
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["Incoming request to /r/:shortCode"] --> B{"Before fix: isHosted check at build time"}
B -->|"isHosted = false (ECS build)"| C["Route never registered ❌"]
B -->|"isHosted = true (local dev)"| D["302 Redirect to go.trybeluga.ai"]
A --> E{"After fix: No guard, rewrite"}
E --> F["Transparent rewrite to go.trybeluga.ai ✅"]
F --> G["User sees /r/:shortCode in browser"]
G --> H["Server proxies to https://go.trybeluga.ai/:shortCode"]
Last reviewed commit: 4eda1ec |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
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
isHostedguard from Beluga short link redirect —isHostedevaluates at build time butNEXT_PUBLIC_APP_URLis a runtime env var on ECS, so the redirect was never registeredsimstudio.aidomain redirects (same issue, and simstudio.ai doesn't have HTTPS configured)isHostedimport from next.config.tsType of Change
Testing
/discordredirect works (not gated byisHosted)/r/9Px2Vreturns 404 on production (confirms redirect was never registered)isHostedset to true — redirect worksChecklist