Exclude null requestURI in MHSR.getRequestURL()
This commit undoes the changes made in ec5d81e78e and ensures that the
getRequestURL() method in MockHttpServletRequest does not include the
String "null" for a null requestURI by first checking if the requestURI
contains text before including it in the composed URL.
Issue: SPR-10643
This commit is contained in:
@@ -211,6 +211,13 @@ public class MockHttpServletRequestTests {
|
||||
assertEquals("http://localhost", requestURL.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getRequestURLWithNullRequestUri() {
|
||||
request.setRequestURI(null);
|
||||
StringBuffer requestURL = request.getRequestURL();
|
||||
assertEquals("http://localhost", requestURL.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getRequestURLWithDefaultsAndHttps() {
|
||||
request.setScheme("https");
|
||||
|
||||
Reference in New Issue
Block a user