mirror of
https://github.com/coder/coder.git
synced 2025-07-18 14:17:22 +00:00
fix(coderd/debug): putDeploymentHealthSettings: use 204 instead of 304 if not modified (#11048)
This commit is contained in:
@ -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
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user