diff --git a/src/lib/routes/admin-api/state.ts b/src/lib/routes/admin-api/state.ts index a195bd6636..45499c02da 100644 --- a/src/lib/routes/admin-api/state.ts +++ b/src/lib/routes/admin-api/state.ts @@ -23,6 +23,10 @@ import { OpenAPIV3 } from 'openapi-types'; const upload = multer({ limits: { fileSize: 5242880 } }); const paramToBool = (param, def) => { + if (typeof param === 'boolean') { + return param; + } + if (param === null || param === undefined) { return def; } diff --git a/src/test/e2e/api/admin/state.e2e.test.ts b/src/test/e2e/api/admin/state.e2e.test.ts index 9cd69cab13..e743d47dfe 100644 --- a/src/test/e2e/api/admin/state.e2e.test.ts +++ b/src/test/e2e/api/admin/state.e2e.test.ts @@ -55,6 +55,12 @@ test('exports strategies and features as attachment', async () => { .expect(200); }); +test('accepts "true" and "false" as parameter values', () => { + return app.request + .get('/api/admin/state/export?strategies=true&tags=false') + .expect(200); +}); + test('imports strategies and features', async () => { return app.request .post('/api/admin/state/import')