Skip to content

Feat: re-write GitHub pagination links #48

@erezrokah

Description

@erezrokah

Not sure if a feature or a bug.

See here decaporg/decap-cms#3135.

When working with GitHub paginated endpoints the next content URLs are sent back in the Link header.
For example curl --head https://api.github.com/repos/erezrokah/netlify-cms-reproductions/pulls will return:

HTTP/1.1 200 OK
Date: Fri, 24 Jan 2020 07:18:44 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 580116
Server: GitHub.com
Status: 200 OK
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 49
X-RateLimit-Reset: 1579852666
Cache-Control: public, max-age=60, s-maxage=60
Vary: Accept
ETag: "594fc31b8d42b4e4782492e5c7619d62"
X-GitHub-Media-Type: github.v3; format=json
Link: <https://api.github.com/repositories/233790256/pulls?page=2>; rel="next", <https://api.github.com/repositories/233790256/pulls?page=2>; rel="last"
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type
Access-Control-Allow-Origin: *
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Frame-Options: deny
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Content-Security-Policy: default-src 'none'
Vary: Accept-Encoding
X-GitHub-Request-Id: FB16:3B0C0:5955597:6B4F95F:5E2A9A53

I think it makes sense for git-gateway to re-write them to make it easier for clients to follow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions