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

simpleRestProvider: using a custom http header to count items in a collection #5224

Merged
merged 3 commits into from
Sep 7, 2020

Conversation

alexisjanvier
Copy link
Contributor

Historically, Simple REST Data Provider uses the http Content-Range header to retrieve the number of items in a collection. But this is a hack of the primary role of this header.

And this can be problematic, for example within an infrastructure using a Varnish that may use, modify or delete this header. We also have feedback indicating that using this header is problematic when you host your application on Versel.

The solution is to use another http header to return the number of collection's items.

This PR introduces a third optional parameter to the simpleRestProvider allowing to define this header.

@alexisjanvier alexisjanvier added enhancement RFR Ready For Review labels Sep 2, 2020
packages/ra-data-simple-rest/README.md Outdated Show resolved Hide resolved
packages/ra-data-simple-rest/README.md Outdated Show resolved Hide resolved
@djhi djhi added this to the 3.9.0 milestone Sep 7, 2020
@djhi djhi merged commit c023d3d into next Sep 7, 2020
@djhi djhi deleted the simple-rest-count-http-header branch September 7, 2020 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants