Skip to content

Link headers are parsed incorrectly #170

@pinoaffe

Description

@pinoaffe

When using ghub-get's :unpaginate feature on certain REST API endpoints (such as https://codeberg.org/api/v1/repos/forgejo/forgejo/pulls), I noticed that the unpagination wasn't working, instead only the first page of results was being returned.

This led me to investigate, and I found out that there's a bug in ghub-response-link-relations: it does not parse Link headers properly: it expects whitespace in places where it's not mandatory, doesn't handle whitespace in places where it's allowed, doesn't properly handle escaped characters, etc

RFC 8288 specifies the format of Link headers, how to parse them, and how to handle errors while parsing them.

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