EndpointRequest should check that the request is to the mgmt context
Fixes gh-15702
This commit is contained in:
@@ -56,6 +56,14 @@ public class ManagementPortAndPathSampleActuatorApplicationTests {
|
||||
assertThat(entity.getBody()).contains("Hello World");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void actuatorPathOnMainPortShouldNotMatch() {
|
||||
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(
|
||||
"http://localhost:" + this.port + "/actuator/health",
|
||||
String.class);
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.UNAUTHORIZED);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSecureActuator() {
|
||||
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(
|
||||
|
||||
Reference in New Issue
Block a user