{"action":"closed","issue":{"url":"https://api.github.com/repos/chaijs/chai-http/issues/186","repository_url":"https://api.github.com/repos/chaijs/chai-http","labels_url":"https://api.github.com/repos/chaijs/chai-http/issues/186/labels{/name}","comments_url":"https://api.github.com/repos/chaijs/chai-http/issues/186/comments","events_url":"https://api.github.com/repos/chaijs/chai-http/issues/186/events","html_url":"https://github.com/chaijs/chai-http/issues/186","id":270853072,"number":186,"title":"Can't send boolean value in multipart/formdata request","user":{"login":"ablankenship10","id":1980841,"avatar_url":"https://avatars0.githubusercontent.com/u/1980841?v=4","gravatar_id":"","url":"https://api.github.com/users/ablankenship10","html_url":"https://github.com/ablankenship10","followers_url":"https://api.github.com/users/ablankenship10/followers","following_url":"https://api.github.com/users/ablankenship10/following{/other_user}","gists_url":"https://api.github.com/users/ablankenship10/gists{/gist_id}","starred_url":"https://api.github.com/users/ablankenship10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ablankenship10/subscriptions","organizations_url":"https://api.github.com/users/ablankenship10/orgs","repos_url":"https://api.github.com/users/ablankenship10/repos","events_url":"https://api.github.com/users/ablankenship10/events{/privacy}","received_events_url":"https://api.github.com/users/ablankenship10/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-11-03T00:56:43Z","updated_at":"2017-11-12T16:58:03Z","closed_at":"2017-11-12T16:58:03Z","author_association":"NONE","body":"I have an API that requires a file to be uploaded along with a few other fields of data. One of those fields is a boolean value. When sending this I get this error:\r\n\r\n```\r\nUncaught TypeError: Invalid non-string/buffer chunk\r\n      at validChunk (_stream_writable.js:254:10)\r\n      at Transform.Writable.write (_stream_writable.js:288:21)\r\n      at FormData.ondata (internal/streams/legacy.js:16:26)\r\n      at FormData.CombinedStream.write (node_modules/combined-stream/lib/combined_stream.js:118:8)\r\n      at FormData.CombinedStream._pipeNext (node_modules/combined-stream/lib/combined_stream.js:106:8)\r\n      at FormData.CombinedStream._getNext (node_modules/combined-stream/lib/combined_stream.js:79:10)\r\n      at FormData.CombinedStream._pipeNext (node_modules/combined-stream/lib/combined_stream.js:107:8)\r\n      at FormData.CombinedStream._getNext (node_modules/combined-stream/lib/combined_stream.js:79:10)\r\n      at FormData.CombinedStream._pipeNext (node_modules/combined-stream/lib/combined_stream.js:107:8)\r\n      at FormData.<anonymous> (node_modules/combined-stream/lib/combined_stream.js:91:10)\r\n      at FormData.<anonymous> (node_modules/form-data/lib/form_data.js:248:5)\r\n```\r\n\r\n\r\nCODE:\r\n\r\n```\r\nchai.request(app)\r\n        .post('/v1/upload')\r\n        .set('x-auth-token', DataStore.UserToken)\r\n        .set('Content-Type', 'multipart/formdata')\r\n        .attach('file', FILE_BUFFER, 'file.zip')\r\n        .field('title', 'Some Title')\r\n        .field('image', 'IMAGE_URL')\r\n        .field('language', 'en')\r\n        .field('public', true)\r\n        .end((err, res) => {\r\n          // ...\r\n          done()\r\n        })\r\n```\r\n\r\nThis does not happen when I send the same `public` field as a 1 or 0 integer, but I think booleans should be supported. This may be functionality of another library (combined-stream?) but figure id post here anyway so i dont choose the wrong one."}}
{"actor":{"display_login":"keithamus"}}