Skip to content

Commit 592d444

Browse files
committed
chore: delete user codersdk to support status code regression
1 parent 203f48a commit 592d444

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

codersdk/users.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,11 @@ func (c *Client) DeleteUser(ctx context.Context, id uuid.UUID) error {
309309
return err
310310
}
311311
defer res.Body.Close()
312-
if res.StatusCode != http.StatusOK {
312+
// Check for both status codes, there was a release that changed this response
313+
// to StatusNoContent. To be compatible with that, the second condition is
314+
// included.
315+
// The 'http.StatusNoContent' check can be removed in 2025
316+
if res.StatusCode != http.StatusOK && res.StatusCode != http.StatusNoContent {
313317
return ReadBodyAsError(res)
314318
}
315319
return nil

0 commit comments

Comments
 (0)