Hi,

I justed stumbled upon a strange behaviour of the /actuator/env/{toMatch} endpoint, e.g. /actuator/env/activeProfiles It returns content but with a 404 status code while I was expecting a 200.

I see this with spring-boot 2.1.6 and 2.2.4 alike. Let me know if you need a demo project in case you are unable to reproduce it.

I am not sure if these topics are related? #18191 | #608

Thanks in advance!

Comment From: wilkinsona

There's no property named activeProfiles so a 404 response is to be expected there. The fact that there's a body is intentional as it means that the response can still provide some information about the property sources that are available. See https://github.com/spring-projects/spring-boot/issues/10179 for details.

I'm going to flag this for team attention so that we can double-check that we agree the current behaviour is what we want. It's unconventional for the server to indicate that a resource doesn't exist (404 response) while including information in the response that is specific to the URI that was called.

Comment From: wilkinsona

We're going to update the endpoint to return an empty body for 404 responses.

Comment From: wilkinsona

We should also double-check that no other endpoint operations return a 404 with a body.

Comment From: scottfrederick

No other endpoint operations return 404 with a body.