diff --git a/src/http.js b/src/http.js index 936d27750..544d6b357 100644 --- a/src/http.js +++ b/src/http.js @@ -144,7 +144,8 @@ function formatValue({value, collectionFormat, allowEmptyValue}, skipEncoding) { if (typeof value === 'undefined' && allowEmptyValue) { return '' } - if (isFile(value)) { + + if (isFile(value) || typeof value === 'boolean') { return value } diff --git a/test/http.js b/test/http.js index 30b7ca2de..0b6bec30e 100644 --- a/test/http.js +++ b/test/http.js @@ -211,11 +211,14 @@ describe('http', () => { }, two: { value: 2 + }, + three: { + value: false } } } - expect(encodeFormOrQuery(req.query)).toEqual('one=1&two=2') + expect(encodeFormOrQuery(req.query)).toEqual('one=1&two=2&three=false') }) it('should handle arrays', function () {