cdnjs / api-server

📡 API server for api.cdnjs.com - The #1 free and open source CDN built to make life easier for developers.
https://api.cdnjs.com
MIT License
89 stars 38 forks source link

Make query fields handling robust #19

Closed MattIPv4 closed 4 years ago

MattIPv4 commented 4 years ago

Resolves an API error observed through Sentry, where our handling of query parameter fields was failing.

Whilst I'm not certain, I think this is likely because multiple query parameters of the same name were passed, which Express automatically parses as an array. Our logic in the app expected these fields to always be strings, so it failed.

https://sentry.io/share/issue/5257843124d84f1caa81205eb53e7ede/

This PR resolves this by adding logic for when an array is passed from Express.