scaleway / scaleway-sdk-go

Integrate Scaleway with your Go application

Home Page:https://pkg.go.dev/github.com/scaleway/scaleway-sdk-go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EOF when pagination is enabled and the call returns a 404

Sh4d1 opened this issue · comments

version: 4a0f25b
Example:

instanceAPI := instance.NewAPI(scwClient)
name := "2sdafsf"
resp, err := instanceAPI.ListServers(&instance.ListServersRequest{
  Zone: utils.ZoneFrPar2,
}, scw.WithAllPages())
if err != nil {
  log.Fatalf("%v", err)
}

Response:

DEBUG: 2019/06/06 12:07:26 client: using sdk version 0.0.0
DEBUG: 2019/06/06 12:07:26 creating GET request on https://api.scaleway.com/instance/v1/zones/fr-par-2/servers?page=1
DEBUG: 2019/06/06 12:07:26 dumping http request:
GET /instance/v1/zones/fr-par-2/servers?page=1 HTTP/1.1
Host: api.scaleway.com
User-Agent: xxxxx
X-Auth-Token: xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Accept-Encoding: gzip

DEBUG: 2019/06/06 12:07:27 dumping http response:
HTTP/2.0 404 Not Found
Content-Length: 23
Content-Security-Policy: default-src 'none'; frame-ancestors 'none'
Content-Type: application/json
Date: Thu, 06 Jun 2019 10:07:22 GMT
Server: scaleway_api
Strict-Transport-Security: max-age=63072000
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Request-Id: f4921ff7-a4b4-4cc4-b21f-8381fe618370

{"message":"Not found"}
2019/06/06 12:07:27 [scaleway-sdk-go] could not parse response body: EOF
exit status 1

fixed by #83