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-2016 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.
@@ -159,7 +159,7 @@ public Principal getPrincipal() {
159
159
160
160
@ Override
161
161
public InetSocketAddress getLocalAddress () {
162
- return new InetSocketAddress (this .servletRequest .getLocalName (), this .servletRequest .getLocalPort ());
162
+ return new InetSocketAddress (this .servletRequest .getLocalAddr (), this .servletRequest .getLocalPort ());
163
163
}
164
164
165
165
@ Override
@@ -180,7 +180,10 @@ public InputStream getBody() throws IOException {
180
180
@ Override
181
181
public ServerHttpAsyncRequestControl getAsyncRequestControl (ServerHttpResponse response ) {
182
182
if (this .asyncRequestControl == null ) {
183
- Assert .isInstanceOf (ServletServerHttpResponse .class , response );
183
+ if (!(response instanceof ServletServerHttpResponse )) {
184
+ throw new IllegalArgumentException (
185
+ "Response must be a ServletServerHttpResponse: " + response .getClass ());
186
+ }
184
187
ServletServerHttpResponse servletServerResponse = (ServletServerHttpResponse ) response ;
185
188
this .asyncRequestControl = new ServletServerHttpAsyncRequestControl (this , servletServerResponse );
186
189
}
You can’t perform that action at this time.
0 commit comments