Skip to content

Commit 1dede34

Browse files
committed
Implemented #504
1 parent 362ad36 commit 1dede34

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ You can enable the following middleware using the "middlewares" config parameter
161161
- "validation": Return input validation errors for custom rules
162162
- "sanitation": Apply input sanitation on create and update
163163
- "multiTenancy": Restricts tenants access in a multi-tenant scenario
164-
- "pageLimits": Restricts list operations to prevent heavy load and scraping
164+
- "pageLimits": Restricts list operations to prevent high load and scraping
165165
- "customization": Provides handlers for request and response customization
166166

167167
The "middlewares" config parameter is a comma separated list of enabled middlewares.
@@ -729,6 +729,16 @@ If your tenants are identified by the "customer_id" column you can use the follo
729729
This construct adds a filter requiring "customer_id" to be "12" to every operation (except for "create").
730730
It also sets the column "customer_id" on "create" to "12" and removes the column from any other write operation.
731731

732+
### Prevent high load and scraping
733+
734+
You may use the "pageLimits" middleware to limit the page number and the number records returned from a list operation.
735+
If you want no more than 10 pages with a maximum of 25 records each, you can specify:
736+
737+
'pageLimits.pages' => 10,
738+
'pageLimits.records' => 25,
739+
740+
NB: The maximum number of records is also applied when there is no page number specified in the request.
741+
732742
### Customization handlers
733743

734744
You may use the "customization" middleware to modify request and response and implement any other functionality.

0 commit comments

Comments
 (0)