1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00
unleash.unleash/src
Thomas Heartman d5e33ab1f2
Fix(export API): accept true and false as param values (#2349)
## What

This PR updates the `paramToBool` function to first check whether the
incoming argument is a boolean. This fixes the bug where using `true` or
`false` (e.g. `Strategies=false`) in the query would cause the server to
crash.

I've also added a test case to check for these values.

## Why

While working on the import/export API docs, I noticed that using
`false` in an export request caused the server to crash.

As we want to allow `true` and `false` (and use these values in the
documentation), we should ensure that they work as expected.

## Background

It's likely that this bug was introduced when we added the new OpenAPI
query parameters to the export endpoint. Because of the way that the
OpenAPI service we use does conversion, we now get `true` and `false`
converted to actual boolean values instead of strings. The `paramToBool`
function didn't account for that previously, which is why it caused the
server to crash.
2022-11-08 15:25:02 +01:00
..
lib Fix(export API): accept true and false as param values (#2349) 2022-11-08 15:25:02 +01:00
mailtemplates
migrations Remove uniqueness from change requests merging (#2332) 2022-11-04 10:57:45 +02:00
test Fix(export API): accept true and false as param values (#2349) 2022-11-08 15:25:02 +01:00
migrator.ts
server-dev.ts fix: generate all hour buckets if missing (#2319) 2022-11-04 09:30:02 +01:00
server.ts