Skip to content

Commit

Permalink
Consistent use of getLocalAddr() without DNS lookups in request adapters
Browse files Browse the repository at this point in the history
Closes gh-28280
  • Loading branch information
jhoeller committed Apr 8, 2022
1 parent 5cbf85a commit 87b5080
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -195,7 +195,7 @@ public Principal getPrincipal() {

@Override
public InetSocketAddress getLocalAddress() {
return new InetSocketAddress(this.servletRequest.getLocalName(), this.servletRequest.getLocalPort());
return new InetSocketAddress(this.servletRequest.getLocalAddr(), this.servletRequest.getLocalPort());
}

@Override
Expand All @@ -216,7 +216,7 @@ public InputStream getBody() throws IOException {
@Override
public ServerHttpAsyncRequestControl getAsyncRequestControl(ServerHttpResponse response) {
if (this.asyncRequestControl == null) {
if (!ServletServerHttpResponse.class.isInstance(response)) {
if (!(response instanceof ServletServerHttpResponse)) {
throw new IllegalArgumentException(
"Response must be a ServletServerHttpResponse: " + response.getClass());
}
Expand Down

0 comments on commit 87b5080

Please sign in to comment.