Skip to content
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

Lang.getIP(request) 取值不正确 #1588

Open
sfss5362 opened this issue Nov 17, 2021 · 4 comments
Open

Lang.getIP(request) 取值不正确 #1588

sfss5362 opened this issue Nov 17, 2021 · 4 comments

Comments

@sfss5362
Copy link

sfss5362 commented Nov 17, 2021

X-Forwarded-For="unknown, 200.55.190.53"

Lang.getIP(request) 得到的为空 ???
不应该是 200.55.190.53 吗 ?

@wendal
Copy link
Member

wendal commented Nov 17, 2021

什么前端(nginx?apache?)会产生这种x_forwarded_for? 这算是有意构建的错误值吧? 返回空挺合理的

@sfss5362
Copy link
Author

数据来自用户请求上来的, 只有这一条 . 不好复现 .
按照 Lang.getIP 的逻辑 , 本应该返回200.55.190.53 , 只是因为没 trim 所以才返回了空.

@sfss5362
Copy link
Author

sfss5362 commented Nov 18, 2021

什么前端(nginx?apache?)会产生这种x_forwarded_for? 这算是有意构建的错误值吧? 返回空挺合理的

x_forwarded_for , 我只是示意一下, 不好意思写错了.
L2691

这里已经取到了 ip="unknown, 200.55.190.53" , 但是最终结果返回空.

@wendal
Copy link
Member

wendal commented Nov 20, 2021

提个 pull request? 不晓得你要改啥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants