Skip to content

Commit

Permalink
ghub-response-link-relations: Fix for GitLab
Browse files Browse the repository at this point in the history
They changed the name of the header from `Link' to `link', or maybe
they always did the latter (though I expect this issue would have been
reported a long time ago, if that were the case).

To this day, the section [1] where they documents this header, is name
"Pagination `Link' header" (with `Link' using code syntax), which is
misleading, especially consider that HTTP headers traditionally are
capitalized [2], but in their API it is not (while some others are).

[1]: https://docs.gitlab.com/ee/api/rest/index.html#pagination-link-header
[2]: https://www.iana.org/assignments/http-fields/http-fields.xhtml#field-names
  • Loading branch information
tarsius committed Oct 26, 2023
1 parent f2840b8 commit 0d7c81e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lisp/ghub.el
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,9 @@ this function is called with nil for PAYLOAD."
(setq-default ghub-response-headers headers))
page)
(cdr (assq 'link-alist ghub-response-headers)))
(and-let* ((rels (cdr (assoc "Link" (or headers ghub-response-headers)))))
(and-let* ((headers (or headers ghub-response-headers))
(rels (cdr (or (assoc "Link" headers)
(assoc "link" headers)))))
(mapcar (lambda (elt)
(pcase-let ((`(,url ,rel) (split-string elt "; ")))
(cons (intern (substring rel 5 -1))
Expand Down

0 comments on commit 0d7c81e

Please sign in to comment.