-
Notifications
You must be signed in to change notification settings - Fork 87
Fix/validation-error #127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix/validation-error #127
Conversation
|
@Shivam107 is attempting to deploy a commit to the AJEET PRATAP SINGH's projects Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughParses the TRUST_PROXY environment variable (boolean, numeric, or string) and sets Express's "trust proxy" using the parsed value, defaulting to 1 when unspecified. No public API or exported signatures were changed. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Comment |
|
On the previous one the files of both PR's got merged , here i have a file that fixes the exact issue which is mentioned. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/api/src/index.ts(1 hunks)
🔇 Additional comments (1)
apps/api/src/index.ts (1)
29-29: Good placement of trust proxy configuration.The trust proxy setting is correctly applied early, before rate limiting and IP blocking middleware that depend on accurate client IP detection. This positioning ensures the
X-Forwarded-Forheader is properly parsed throughout the request lifecycle, resolving the ValidationError from issue #60.Note: The default of
1assumes a single proxy hop (common in platforms like Railway, Heroku). Verify this matches your deployment architecture to prevent IP spoofing risks.
Solved the Express 'trust proxy' setting
Fixes: #60
This image shows the trust proxy config is working.
console.log() - I added this just for testing purpose and now I had removed it
/debug-ip - I added this also just for testing purpose and now I had removed it
Summary by CodeRabbit