From c9600f71da413fba699f21d518de4c29e2dab3ba Mon Sep 17 00:00:00 2001 From: Aditya Saha Date: Wed, 23 Oct 2024 10:30:35 -0400 Subject: [PATCH] Adjust delete dangerous (#744) --- droplet_autoscale.go | 2 +- droplet_autoscale_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/droplet_autoscale.go b/droplet_autoscale.go index f948388..4ef9dff 100644 --- a/droplet_autoscale.go +++ b/droplet_autoscale.go @@ -249,7 +249,7 @@ func (d *DropletAutoscaleServiceOp) Delete(ctx context.Context, id string) (*Res // DeleteDangerous deletes an existing autoscale pool with all underlying resources func (d *DropletAutoscaleServiceOp) DeleteDangerous(ctx context.Context, id string) (*Response, error) { - req, err := d.client.NewRequest(ctx, http.MethodDelete, fmt.Sprintf("%s/%s", dropletAutoscaleBasePath, id), nil) + req, err := d.client.NewRequest(ctx, http.MethodDelete, fmt.Sprintf("%s/%s/dangerous", dropletAutoscaleBasePath, id), nil) req.Header.Set("X-Dangerous", "true") if err != nil { return nil, err diff --git a/droplet_autoscale_test.go b/droplet_autoscale_test.go index 6f80ac1..c5eba7f 100644 --- a/droplet_autoscale_test.go +++ b/droplet_autoscale_test.go @@ -603,7 +603,7 @@ func TestDropletAutoscaler_DeleteDangerous(t *testing.T) { defer teardown() autoscalePoolID := "d50d8276-ad17-475d-8d2a-26b0acac756c" - mux.HandleFunc(fmt.Sprintf("%s/%s", dropletAutoscaleBasePath, autoscalePoolID), func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc(fmt.Sprintf("%s/%s/dangerous", dropletAutoscaleBasePath, autoscalePoolID), func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, http.MethodDelete) if expectedHeader, err := strconv.ParseBool(r.Header.Get("X-Dangerous")); err != nil { t.Fatal(err)