Issue gh-14553
This commit is contained in:
Josh Cummings 2024-03-22 16:27:16 -06:00
parent afcce0c277
commit e18ec48134
No known key found for this signature in database
GPG Key ID: A306A51F43B8E5A5
2 changed files with 2 additions and 7 deletions

View File

@ -29,7 +29,7 @@ public class OidcBackChannelLogoutHandlerTests {
public void computeLogoutEndpointWhenDifferentHostnameThenLocalhost() {
OidcBackChannelLogoutHandler logoutHandler = new OidcBackChannelLogoutHandler();
MockHttpServletRequest request = new MockHttpServletRequest("GET", "/back-channel/logout");
request.setRemoteHost("host.docker.internal");
request.setServerName("host.docker.internal");
request.setServerPort(8090);
String endpoint = logoutHandler.computeLogoutEndpoint(request);
assertThat(endpoint).isEqualTo("http://localhost:8090/logout");

View File

@ -17,12 +17,8 @@
package org.springframework.security.config.web.server;
import org.junit.jupiter.api.Test;
import reactor.core.publisher.Mono;
import org.springframework.mock.http.server.reactive.MockServerHttpRequest;
import org.springframework.mock.web.server.MockServerWebExchange;
import org.springframework.security.web.server.WebFilterExchange;
import org.springframework.web.server.ServerWebExchange;
import static org.assertj.core.api.Assertions.assertThat;
@ -38,8 +34,7 @@ public class OidcBackChannelServerLogoutHandlerTests {
MockServerHttpRequest request = MockServerHttpRequest
.get("https://host.docker.internal:8090/back-channel/logout")
.build();
ServerWebExchange exchange = new MockServerWebExchange.Builder(request).build();
String endpoint = logoutHandler.computeLogoutEndpoint(new WebFilterExchange(exchange, (ex) -> Mono.empty()));
String endpoint = logoutHandler.computeLogoutEndpoint(request);
assertThat(endpoint).isEqualTo("https://localhost:8090/logout");
}