Skip to content

Link header is missing from the response #380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
c10b10 opened this issue Oct 3, 2016 · 2 comments
Closed

Link header is missing from the response #380

c10b10 opened this issue Oct 3, 2016 · 2 comments

Comments

@c10b10
Copy link
Contributor

c10b10 commented Oct 3, 2016

❯ curl -I "http://localhost:3001/?_page=1"

HTTP/1.1 200 OK
X-Powered-By: Express
Vary: Origin, Accept-Encoding
Access-Control-Allow-Credentials: true
Accept-Ranges: bytes
Cache-Control: public, max-age=0
Last-Modified: Mon, 19 Sep 2016 08:48:27 GMT
ETag: W/"4c0-15741a1d378"
Content-Type: text/html; charset=UTF-8
Content-Length: 1216
Date: Mon, 03 Oct 2016 14:45:18 GMT
Connection: keep-alive

Any idea why this is happening?

@typicode
Copy link
Owner

typicode commented Oct 3, 2016

Hi @c10b10,

Yes, you need to use it on a resource:

/posts?_page=1
/comments?_page=1
...

@c10b10
Copy link
Contributor Author

c10b10 commented Oct 4, 2016

Using it on a resource indeed returns all the headers, including the Link header. So does the request I see in the browser network tab.

Not the same thing can be said abut the javascript fetch. When I call response.headers.get('Link') in the fetch then, I get null. Listing all the headers I receive in the fetch response, I get:

x-total-count: 100
pragma: no-cache
content-type: application/json; charset=utf-8
cache-control: no-cache
expires: -1

Seems that the Links header is not set in the Access-Control-Expose-Headers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants