File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
spring-web/src/main/java/org/springframework/http/server Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2015 the original author or authors.
2
+ * Copyright 2002-2022 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -148,7 +148,7 @@ public Principal getPrincipal() {
148
148
149
149
@ Override
150
150
public InetSocketAddress getLocalAddress () {
151
- return new InetSocketAddress (this .servletRequest .getLocalName (), this .servletRequest .getLocalPort ());
151
+ return new InetSocketAddress (this .servletRequest .getLocalAddr (), this .servletRequest .getLocalPort ());
152
152
}
153
153
154
154
@ Override
@@ -169,7 +169,10 @@ public InputStream getBody() throws IOException {
169
169
@ Override
170
170
public ServerHttpAsyncRequestControl getAsyncRequestControl (ServerHttpResponse response ) {
171
171
if (this .asyncRequestControl == null ) {
172
- Assert .isInstanceOf (ServletServerHttpResponse .class , response );
172
+ if (!(response instanceof ServletServerHttpResponse )) {
173
+ throw new IllegalArgumentException (
174
+ "Response must be a ServletServerHttpResponse: " + response .getClass ());
175
+ }
173
176
ServletServerHttpResponse servletServerResponse = (ServletServerHttpResponse ) response ;
174
177
this .asyncRequestControl = new ServletServerHttpAsyncRequestControl (this , servletServerResponse );
175
178
}
You can’t perform that action at this time.
0 commit comments