File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
spring-web/src/main/java/org/springframework/http/server Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2014 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
@@ -167,7 +167,8 @@ public InputStream getBody() throws IOException {
167
167
}
168
168
169
169
private boolean isFormPost (HttpServletRequest request ) {
170
- return (request .getContentType () != null && request .getContentType ().contains (FORM_CONTENT_TYPE ) &&
170
+ String contentType = request .getContentType ();
171
+ return (contentType != null && contentType .contains (FORM_CONTENT_TYPE ) &&
171
172
METHOD_POST .equalsIgnoreCase (request .getMethod ()));
172
173
}
173
174
You can’t perform that action at this time.
0 commit comments