@@ -145,7 +145,7 @@ public class MockHttpServletRequestBuilder
145
145
* <p>Although this class cannot be extended, additional ways to initialize
146
146
* the {@code MockHttpServletRequest} can be plugged in via
147
147
* {@link #with(RequestPostProcessor)}.
148
- * @param httpMethod the HTTP method (GET, POST, etc)
148
+ * @param httpMethod the HTTP method (GET, POST, etc. )
149
149
* @param url a URL template; the resulting URL will be encoded
150
150
* @param vars zero or more URI variables
151
151
*/
@@ -164,7 +164,7 @@ private static URI initUri(String url, Object[] vars) {
164
164
/**
165
165
* Alternative to {@link #MockHttpServletRequestBuilder(HttpMethod, String, Object...)}
166
166
* with a pre-built URI.
167
- * @param httpMethod the HTTP method (GET, POST, etc)
167
+ * @param httpMethod the HTTP method (GET, POST, etc. )
168
168
* @param url the URL
169
169
* @since 4.0.3
170
170
*/
@@ -797,7 +797,7 @@ public final MockHttpServletRequest buildRequest(ServletContext servletContext)
797
797
}
798
798
}
799
799
catch (Exception ex ) {
800
- // Must be invalid, ignore..
800
+ // Must be invalid, ignore
801
801
}
802
802
}
803
803
}
@@ -894,7 +894,8 @@ private MultiValueMap<String, String> parseFormData(MediaType mediaType) {
894
894
HttpInputMessage message = new HttpInputMessage () {
895
895
@ Override
896
896
public InputStream getBody () {
897
- return (content != null ? new ByteArrayInputStream (content ) : InputStream .nullInputStream ());
897
+ byte [] bodyContent = MockHttpServletRequestBuilder .this .content ;
898
+ return (bodyContent != null ? new ByteArrayInputStream (bodyContent ) : InputStream .nullInputStream ());
898
899
}
899
900
@ Override
900
901
public HttpHeaders getHeaders () {
0 commit comments