Manual URL Cleanup

This commit is contained in:
Joe Grandja
2019-03-28 14:37:42 -04:00
parent 9b09201679
commit 4e9c37b1ae
17 changed files with 475 additions and 484 deletions

View File

@@ -52,7 +52,7 @@ public class DefaultRedirectStrategyTests {
MockHttpServletResponse response = new MockHttpServletResponse();
rds.sendRedirect(request, response,
"https://http://context.blah.com/context/remainder");
"https://context.blah.com/context/remainder");
assertThat(response.getRedirectedUrl()).isEqualTo("remainder");
}

View File

@@ -85,7 +85,7 @@ public class RetryWithHttpEntryPointTests {
"/bigWebApp/hello/pathInfo.html");
request.setQueryString("open=true");
request.setScheme("https");
request.setServerName("www.example.com");
request.setServerName("localhost");
request.setServerPort(443);
MockHttpServletResponse response = new MockHttpServletResponse();
@@ -96,7 +96,7 @@ public class RetryWithHttpEntryPointTests {
ep.commence(request, response);
assertThat(response.getRedirectedUrl()).isEqualTo(
"http://www.example.com/bigWebApp/hello/pathInfo.html?open=true");
"http://localhost/bigWebApp/hello/pathInfo.html?open=true");
}
@Test

View File

@@ -385,7 +385,7 @@ public class AbstractAuthenticationProcessingFilterTests {
MockHttpServletResponse response = new MockHttpServletResponse();
MockAuthenticationFilter filter = new MockAuthenticationFilter(false);
successHandler.setDefaultTargetUrl("http://monkeymachine.co.uk/");
successHandler.setDefaultTargetUrl("https://monkeymachine.co.uk/");
filter.setAuthenticationSuccessHandler(successHandler);
filter.doFilter(request, response, chain);
@@ -409,7 +409,7 @@ public class AbstractAuthenticationProcessingFilterTests {
ReflectionTestUtils.setField(filter, "logger", logger);
filter.exceptionToThrow = new InternalAuthenticationServiceException(
"Mock requested to do so");
successHandler.setDefaultTargetUrl("http://monkeymachine.co.uk/");
successHandler.setDefaultTargetUrl("https://monkeymachine.co.uk/");
filter.setAuthenticationSuccessHandler(successHandler);
filter.doFilter(request, response, chain);

View File

@@ -249,7 +249,7 @@ public class LoginUrlAuthenticationEntryPointTests {
// SEC-1498
@Test
public void absoluteLoginFormUrlIsSupported() throws Exception {
final String loginFormUrl = "http://somesite.com/login";
final String loginFormUrl = "https://somesite.com/login";
LoginUrlAuthenticationEntryPoint ep = new LoginUrlAuthenticationEntryPoint(
loginFormUrl);
ep.afterPropertiesSet();
@@ -260,9 +260,9 @@ public class LoginUrlAuthenticationEntryPointTests {
@Test(expected = IllegalArgumentException.class)
public void absoluteLoginFormUrlCantBeUsedWithForwarding() throws Exception {
final String loginFormUrl = "http://somesite.com/login";
final String loginFormUrl = "https://somesite.com/login";
LoginUrlAuthenticationEntryPoint ep = new LoginUrlAuthenticationEntryPoint(
"http://somesite.com/login");
"https://somesite.com/login");
ep.setUseForward(true);
ep.afterPropertiesSet();
}

View File

@@ -45,11 +45,11 @@ public class SimpleUrlLogoutSuccessHandlerTests {
@Test
public void absoluteUrlIsSupported() throws Exception {
SimpleUrlLogoutSuccessHandler lsh = new SimpleUrlLogoutSuccessHandler();
lsh.setDefaultTargetUrl("http://someurl.com/");
lsh.setDefaultTargetUrl("https://someurl.com/");
MockHttpServletRequest request = new MockHttpServletRequest();
MockHttpServletResponse response = new MockHttpServletResponse();
lsh.onLogoutSuccess(request, response, mock(Authentication.class));
assertThat(response.getRedirectedUrl()).isEqualTo("http://someurl.com/");
assertThat(response.getRedirectedUrl()).isEqualTo("https://someurl.com/");
}
}