PUT (update) is not a resource-creation operation, so it should not return 201 Created. Verified safe against the shipped ca.AdminClient, which only checks for status >= 400.
@@ -229,5 +229,5 @@ func (war *webhookAdminResponder) UpdateProvisionerWebhook(w http.ResponseWriter
Auth: newWebhook.Auth,
DisableTlsClientAuth: newWebhook.DisableTlsClientAuth,
}
- render.ProtoJSONStatus(w, whResponse, http.StatusCreated)
+ render.ProtoJSONStatus(w, whResponse, http.StatusOK)
@@ -632,7 +632,7 @@ func TestWebhookAdminResponder_UpdateProvisionerWebhook(t *testing.T) {
Url: "https://example.com",
Kind: linkedca.Webhook_ENRICHING,
},
- statusCode: 201,
+ statusCode: 200,