fix(coderd/debug): putDeploymentHealthSettings: use 204 instead of 304 if not modified (#11048)

This commit is contained in:
Cian Johnston
2023-12-05 19:06:56 +00:00
committed by GitHub
parent 876d448d69
commit f66e802fae
2 changed files with 3 additions and 2 deletions

View File

@ -205,7 +205,8 @@ func (api *API) putDeploymentHealthSettings(rw http.ResponseWriter, r *http.Requ
}
if bytes.Equal(settingsJSON, []byte(currentSettingsJSON)) {
httpapi.Write(r.Context(), rw, http.StatusNotModified, nil)
// See: https://www.rfc-editor.org/rfc/rfc7231#section-6.3.5
httpapi.Write(r.Context(), rw, http.StatusNoContent, nil)
return
}

View File

@ -36,7 +36,7 @@ func (c *Client) PutHealthSettings(ctx context.Context, settings HealthSettings)
}
defer res.Body.Close()
if res.StatusCode == http.StatusNotModified {
if res.StatusCode == http.StatusNoContent {
return xerrors.New("health settings not modified")
}
if res.StatusCode != http.StatusOK {