From 959a49f17c4309ce76b4f20ee9bf297fe97aabba Mon Sep 17 00:00:00 2001 From: Aditya Saha Date: Wed, 23 Oct 2024 10:13:51 -0400 Subject: [PATCH] Adjust delete dangerous --- 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 f9483882..4ef9dff8 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 6f80ac18..c5eba7f5 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)