Hi,

Since version 2.2.5, when I call curl localhost:8080/actuator/env -d'{"name":"test",value:"hello world!"}' -H "Content-type: application/json"

I get a {"timestamp":"2020-03-09T16:21:18.245+0000","status":405,"error":"Method Not Allowed","message":"Request method 'POST' not supported","path":"/actuator/env}

(I can issue a GET request without any issue)
(Spring Security is not enabled)

Up to 2.2.4, it was working and I could issue POST requests to update the configuration at runtime without any problem.

Nowhere in the release notes, I can see changes regarding this feature.

Now how can I do to update my env on the fly without restarting the whole application?

Comment From: wilkinsona

Thanks for the report. This sounds like an unintentional regression but Spring Boot's env endpoint is read-only and the write support is an extension that's provided by Spring Cloud so we need to figure out where the problem was introduced.

When you upgraded from Spring Boot 2.2.4 to Spring Boot 2.2.5, did you also upgrade Spring Cloud at the same time?

Comment From: fmartinou

Yes, At the same time, we also upgraded Spring Cloud from Hoxton.SR1 to Hoxton.SR3.

Comment From: wilkinsona

Thanks. After a bit of digging, I've learned that the Spring Cloud team changed the writablde env endpoint to be opt-in in Hoxton.SR3: https://github.com/spring-cloud/spring-cloud-commons/issues/681. You can opt in by setting management.endpoint.env.post.enabled=true.

@spencergibb Do you think this is worth mentioning in the Hoxton.SR3 announcement?

Comment From: spencergibb

@wilkinsona yes, I'll update the blog and release notes

Comment From: spencergibb

done