Skip to content

[bug] Rewriting link headers is wrong #1100

@karlcow

Description

@karlcow

On Github if we request:

http --print h GET https://api.github.com/repos/webcompat/webcompat-tests/issues/398/comments 'Accept:application/json' | grep Link

we get

Link: <https://api.github.com/repositories/17839063/issues/398/comments?page=2>; rel="next", <https://api.github.com/repositories/17839063/issues/398/comments?page=4>; rel="last"

Then

→ http --print h GET 'https://api.github.com/repos/webcompat/webcompat-tests/issues/398/comments?page=2' 'Accept:application/json' | grep Link

Link: <https://api.github.com/repositories/17839063/issues/398/comments?page=3>; rel="next", <https://api.github.com/repositories/17839063/issues/398/comments?page=4>; rel="last", <https://api.github.com/repositories/17839063/issues/398/comments?page=1>; rel="first", <https://api.github.com/repositories/17839063/issues/398/comments?page=1>; rel="prev"

BUT

on webcompat.

we do

→ http --print h GET 'http://localhost:5000/api/issues/398/comments' 'Accept:application/json'

link: <comments?page=2>; rel="next", <comments?page=4>; rel="last"

Then
→ http --print h GET 'http://localhost:5000/api/issues/398/comments?page=2' 'Accept:application/json'

link: <comments?page=2>; rel="next", <comments?page=4>; rel="last"

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions