Allow endpoints to be mapped to /

This commit removes the restriction that was added in 4a61e45 to
prevent / from being used as the management context path when the
management context was not using a different port

The management context path can now be set to / irrespective of the
configuration of the management port. To avoid a possible clash
with the application's welcome page or similar, the links "endpoint"
that is mapping to the management context path is disabled when
the management context path is /.

As part of allowing / to be used as the management context path again,
the handling of endpoint mappings and the creation of paths for
individual operations has been consolidated into a new EndpointMapping
class that is used across the three (MVC, WebFlux, and Jersey)
implementations.

See gh-9898
This commit is contained in:
Andy Wilkinson
2017-09-08 00:12:09 +01:00
parent 4c0a70ced6
commit c06de245d9
18 changed files with 291 additions and 65 deletions

View File

@@ -223,14 +223,15 @@ property. For example, the following will disable _all_ endpoints except for `in
[[production-ready-endpoint-hypermedia]]
=== Hypermedia for actuator MVC endpoints
=== Hypermedia for actuator web endpoints
A "`discovery page`" is added with links to all the endpoints. The "`discovery page`" is
available on `/application` by default.
When a custom management context path is configured, the "`discovery page`" will
automatically move from `/application` to the root of the management context. For example,
if the management context path is `/management` then the discovery page will be available
from `/management`.
from `/management`. When the management context path is set to `/` the discovery page
is disabled to prevent the possiblility of a clash with other mappings.