Werk #16663 · Jul 11, 24
Rest API: change response codes for some endpoints from 302 to 303
Incompatible change. Existing setups may behave differently after upgrading. Review the details below before updating.
Some endpoints accept some data (via POST, PUT), start a background job and then redirect to other "wait-for-completion" endpoints. The wait-for-completion endpoints however expected requests with the GET method. Previously, we used the response code "302 Found" in these cases. Some clients, like the python requests library, always change the method to GET on redirects, but this is not according to the spec. As such "correct" clients ran into issues so we made the decision to update these endpoints to use "303 See other" instead. This status code guarantees a change to the GET method.
Affected endpoints:
- Execute service discovery on host
(
/domain-types/service_discovery_run/actions/start/invoke) - Rename a host
(
/objects/host_config/example.com/actions/rename/invoke) - Activate pending changes
(
/domain-types/activation_run/actions/activate-changes/invoke)
Details
- Class:
- Bug Fixes
- Level:
- Trivial
- Component:
- REST API
- Versions:
- 2.4.0b1All Editions