API testing · Headers
Rate limit header says 140 requests remain out of a limit of 100
P3 · MinorExperiencedHeaders
Want to find it yourself first? This page gives away the answer. Play this bug on a fake app screen and see if you can spot it in three tries.
The clue
Two of these headers should agree with each other.
Steps to reproduce
- Send a few requests to /api/search
- Read the X-RateLimit headers
Expected result
Remaining is between 0 and 100 and goes down with each request
Actual result
X-RateLimit-Remaining: 140
Why it matters
This is a minor (P3) bug. It does not stop anyone, but it looks careless and makes people trust the product less. It is usually fixed in a normal sprint.
Testing tip
Headers are part of the contract. Clients use them to back off, so wrong values cause floods or lockouts.
How to find bugs like this
API bugs live in the JSON between the app and the server: wrong records returned, fields that leak private data, bad status codes and limits that are not enforced. When you test, try these checks:
- Read the whole response body, not only the status code.
- Ask for other users’ records on purpose.
- Look for fields that should never leave the server.
- Send values at and past every limit.