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

开发环境使用 ctx.address() 得到 "27.0.0.1" 问题 #330

Closed
woaer opened this issue Jan 29, 2019 · 1 comment
Closed

开发环境使用 ctx.address() 得到 "27.0.0.1" 问题 #330

woaer opened this issue Jan 29, 2019 · 1 comment
Assignees

Comments

@woaer
Copy link

woaer commented Jan 29, 2019

当我在开发环境使用 RouteContext 上下文的 address() 方法获取请求 ip 时,返回的结果被截断了。

控制器如下:

    @GetRoute("/")
    public String index(RouteContext ctx) {
        log.info("address => {}", ctx.address());
        return "index.html";
    }

通过 http://127.0.0.1:9000/ 访问,下边是调试的截图:

image

环境说明

  1. Windows 7
  2. maven
  3. JDK 1.8 and blade 2.0.12.RELEASE

预期行为

没有测试正式环境获取访问 ip 的问题,不清楚是否符合预期。

附加信息

在这个 commit 415812d 中,增加了字符截取代码,不知是何作用?

@hellokaton
Copy link
Member

这是一个 bug,在 #337 中已修复,感谢你的反馈。

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

No branches or pull requests

2 participants