mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-23 06:29:10 +00:00
Consistently support no value params in query string
Closes gh-35329
This commit is contained in:
+9
@@ -311,6 +311,15 @@ class MockHttpServletRequestBuilderTests {
|
||||
assertThat(request.getParameterMap().get("foo")).containsExactly();
|
||||
}
|
||||
|
||||
@Test // gh-35210
|
||||
void queryStringWithoutValues() {
|
||||
this.builder = new MockHttpServletRequestBuilder(GET).uri("/path?foo");
|
||||
MockHttpServletRequest request = this.builder.buildRequest(this.servletContext);
|
||||
|
||||
assertThat(request.getQueryString()).isEqualTo("foo");
|
||||
assertThat(request.getParameterMap().get("foo")).containsExactly((String) null);
|
||||
}
|
||||
|
||||
@Test
|
||||
void formField() {
|
||||
this.builder = new MockHttpServletRequestBuilder(POST).uri("/");
|
||||
|
||||
Reference in New Issue
Block a user