We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b46c41b + 03c3ec1 commit b9d6a90Copy full SHA for b9d6a90
spring-web/src/main/java/org/springframework/http/server/ServletServerHttpRequest.java
@@ -216,7 +216,9 @@ public InetSocketAddress getLocalAddress() {
216
217
@Override
218
public InetSocketAddress getRemoteAddress() {
219
- return new InetSocketAddress(this.servletRequest.getRemoteAddr(), this.servletRequest.getRemotePort());
+ String addressOrHost = this.servletRequest.getRemoteAddr();
220
+ addressOrHost = (addressOrHost != null ? addressOrHost : this.servletRequest.getRemoteHost());
221
+ return new InetSocketAddress(addressOrHost, this.servletRequest.getRemotePort());
222
}
223
224
0 commit comments