You need to sign in or sign up before continuing.
GET /projects/<id>/hooks returns next link in headers when there are no webhooks
Description of the problem
Request
curl -X GET \
https://gitlab.com/api/v4/projects/jpatters%2Fpersonal.com/hooks \
-H 'authorization: Bearer <redacted>' \
-H 'cache-control: no-cache'
Response
< HTTP/1.1 200 OK
< Server: nginx
< Date: Thu, 17 Aug 2017 04:00:17 GMT
< Content-Type: application/json
< Content-Length: 2
< Cache-Control: max-age=0, private, must-revalidate
< Etag: W/"d751713988987e9331980363e24189ce"
< Link: <https://gitlab.com/api/v4/projects/jpatters%2Fpersonal.com/hooks?id=jpatters%2Fpersonal.com&page=2&per_page=20>; rel="next", <https://gitlab.com/api/v4/projects/jpatters%2Fpersonal.com/hooks?id=jpatters%2Fpersonal.com&page=1&per_page=20>; rel="first", <https://gitlab.com/api/v4/projects/jpatters%2Fpersonal.com/hooks?id=jpatters%2Fpersonal.com&page=0&per_page=20>; rel="last"
< Vary: Origin
< X-Frame-Options: SAMEORIGIN
< X-Next-Page:
< X-Page: 1
< X-Per-Page: 20
< X-Prev-Page:
< X-Request-Id: c09d6da9-f587-4050-bb03-cb5072e00e20
< X-Runtime: 0.152299
< X-Total: 0
< X-Total-Pages: 0
< Strict-Transport-Security: max-age=31536000
<
* Connection #0 to host gitlab.com left intact
[]
Note that there is a "next" link sent when there are no webhooks. This will cause an infinite loop in any reasonably designed library (including the gitlab gem that I am using).
This behaves as expected when there is at least 1 webhook.
Approximate date/time when the error occurred.
Date and time of submission
Describe what you were doing right before the issue occurred.
Trying to list webhooks for a repo that has none