equinixmetal-archive / packngo

[Deprecated] A Golang client for the Equinix Metal API. (Packet is now Equinix Metal)
https://deploy.equinix.com/labs/equinix-sdk-go/
Other
79 stars 60 forks source link

Getting Available IP Reservations sends BODY in GET request #364

Open displague opened 1 year ago

displague commented 1 year ago

https://github.com/packethost/packngo/blob/f12198a6cc4b2ec175302b6e22f32f6605defc33/ip.go#L386

The intention is for the cidr request filtering to be submitted as a query parameter. The request may be rejected as an invalid/suspicious request as coded today.

Succinctly, r should be translated to query params and the request body should be nil as it is everywhere else:

packngo $ git grep -n DoRequest.*GET.*| grep -v nil
ip.go:386:  resp, err := i.client.DoRequest("GET", apiPathQuery, r, ar)