Skip to content

404 response from /actuator/env/{toMatch} should have no body #20314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hennr opened this issue Feb 25, 2020 · 4 comments
Closed

404 response from /actuator/env/{toMatch} should have no body #20314

hennr opened this issue Feb 25, 2020 · 4 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@hennr
Copy link

hennr commented Feb 25, 2020

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!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 25, 2020
@wilkinsona
Copy link
Member

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 #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.

@wilkinsona wilkinsona added for: team-meeting An issue we'd like to discuss as a team to make progress for: team-attention An issue we'd like other members of the team to review and removed for: team-meeting An issue we'd like to discuss as a team to make progress labels Feb 25, 2020
@wilkinsona
Copy link
Member

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

@wilkinsona wilkinsona changed the title /actuator/env/{toMatch} returns 404 404 response from /actuator/env/{toMatch} should have no body Mar 4, 2020
@wilkinsona wilkinsona added type: enhancement A general enhancement and removed for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Mar 4, 2020
@wilkinsona wilkinsona added this to the 2.3.x milestone Mar 4, 2020
@wilkinsona
Copy link
Member

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

@scottfrederick scottfrederick self-assigned this Mar 5, 2020
@scottfrederick
Copy link
Contributor

No other endpoint operations return 404 with a body.

@scottfrederick scottfrederick modified the milestones: 2.3.x, 2.3.0.M3 Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

4 participants