-
-
Notifications
You must be signed in to change notification settings - Fork 773
feat(vercel, netlify, cloudflare): support req.ip
#3952
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
Conversation
|
@huseeiin is attempting to deploy a commit to the Nitro Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughUpdates add client IP extraction and runtime initialization across Netlify, Vercel (Node & Web), and Cloudflare presets; Netlify handler signature tightened to Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
commit: |
req.ip
| ) { | ||
| // replace req.socket.remoteAddress with x-forwarded-for because req.socket.remoteAddress is not accurate and req.socket.remoteAddress is how the srvx node adapter reads the ip. this is subject to debate | ||
| Object.defineProperty(req.socket, "remoteAddress", { | ||
| value: req.headers["x-forwarded-for"], |
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.
/cc @QuiiBz do you think of any better way for Node.js style handler? (can't we rely on original remoteAddress? i see it is currently always 127.0.0.1)
req.ipreq.ip
add more ip support :)