thenewboston-blockchain / Bank

Bank for thenewboston digital currency.
https://thenewboston.com
MIT License
87 stars 42 forks source link

Query parameter `limit=0` will return all list #158

Closed itsnikhil closed 2 years ago

itsnikhil commented 2 years ago

Bug Description When limit is 0, server is returning all the records which can easily cause OOM or huge load on server which I expect to not happen. (P.S.: Not sure to call it a bug or it is expected behavior)

Steps to Reproduce Steps to reproduce the behavior:

  1. Go to 'http://54.183.16.194/bank_transactions?format=json&limit=0'
  2. See result

Expected behavior Limit should be greater than 0 and less than or equal to 100.

Actual behavior Limit can be set to 0

Screenshots/Recordings image

OS and Browser

Account Number e9c5acac0806aca6ba2c0ade74d93ec4f9a89d8743fa477c52ce9b7817dcad95

itsnikhil commented 2 years ago

I think this is more of a feature https://github.com/thenewboston-developers/Bank/blob/master/v1/third_party/rest_framework/pagination.py#L11