diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcHypermediaManagementContextConfiguration.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcHypermediaManagementContextConfiguration.java index 3858c6e968..f61fcbc490 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcHypermediaManagementContextConfiguration.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcHypermediaManagementContextConfiguration.java @@ -128,8 +128,7 @@ public class EndpointWebMvcHypermediaManagementContextConfiguration { ManagementServerProperties management, DocsMvcEndpoint endpoint) { String path = management.getContextPath() + endpoint.getPath() + "/#spring_boot_actuator__{rel}"; - if (server.getPort() == management.getPort() && management.getPort() != null - && management.getPort() != 0) { + if (server.getPort().equals(management.getPort()) && management.getPort() != 0) { path = server.getPath(path); } return new DefaultCurieProvider("boot", new UriTemplate(path));