Skip to content
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

Getting all the headers in response from the Rest APIs #2041

Closed
Shruti3004 opened this issue Jul 6, 2021 · 0 comments · Fixed by #2042
Closed

Getting all the headers in response from the Rest APIs #2041

Shruti3004 opened this issue Jul 6, 2021 · 0 comments · Fixed by #2042

Comments

@Shruti3004
Copy link
Contributor

Shruti3004 commented Jul 6, 2021

The Access-Control-Expose-Headers response header indicates which headers can be exposed as part of the response by listing their names.
By default, only the 6 CORS-safelisted response headers are exposed:
Cache-Control, Content-Language, Content-Type, Expires, Last-Modified, Pragma
If we want clients to be able to access other headers, you have to list them using the Access-Control-Expose-Headers header.

We need to set Access-Control-Expose-Headers in our backend to expose our custom response headers.
Taken from Access-Control-Expose-Headers

Therefore, we have to code your backend to set Access-Control-Expose-Headers such that it returns:
Access-Control-Expose-Headers: x-total-pages

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

Successfully merging a pull request may close this issue.

1 participant