janaipakos / ghibliapi

A simple API for Studio Ghibli resources. Unofficial/fan-made
https://ghibliapi.herokuapp.com
MIT License
310 stars 109 forks source link

500 Internal Error caused by invalid array lenght #31

Open davidecorradini opened 3 years ago

davidecorradini commented 3 years ago

Hello, during the usage of your API instance on Heroku, some of my requests obtained a 500 Internal Error, caused by an invalid array length.

In the species endpoint, with the following request I got the following response: /species?fields=IPcJyhzl&limit=-824525682274219948

RangeError: Invalid array length
    at Function.router.render (/app/src/app.js:46:19)
    at /app/node_modules/json-server/src/server/router/index.js:77:12
    at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/app/node_modules/express/lib/router/index.js:317:13)
    at /app/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)
    at next (/app/node_modules/express/lib/router/index.js:275:10)
    at /app/node_modules/express/lib/router/index.js:635:15
    at next (/app/node_modules/express/lib/router/index.js:260:14)
    at next (/app/node_modules/express/lib/router/route.js:127:14)

In the locations endpoint, with the following request I got the following response: /locations?fields=tqkdIGXe&limit=-5144637366675912606

RangeError: Invalid array length
    at Function.router.render (/app/src/app.js:46:19)
    at /app/node_modules/json-server/src/server/router/index.js:77:12
    at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/app/node_modules/express/lib/router/index.js:317:13)
    at /app/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)
    at next (/app/node_modules/express/lib/router/index.js:275:10)
    at /app/node_modules/express/lib/router/index.js:635:15
    at next (/app/node_modules/express/lib/router/index.js:260:14)
    at next (/app/node_modules/express/lib/router/route.js:127:14)