From 964d5287351234bd8821e61cea6b82a0140a18bd Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Thu, 10 Aug 2017 18:26:45 -0700 Subject: [PATCH 1/2] Replace valueSeq with entrySeq --- src/core/curlify.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/curlify.js b/src/core/curlify.js index 2564ed92..328830c1 100644 --- a/src/core/curlify.js +++ b/src/core/curlify.js @@ -20,7 +20,7 @@ export default function curl( request ){ if ( request.get("body") ){ if(type === "multipart/form-data" && request.get("method") === "POST") { - for( let [ k,v ] of request.get("body").values()) { + for( let [ k,v ] of request.get("body").entrySeq()) { curlified.push( "-F" ) if (v instanceof win.File) { curlified.push( `"${k}=@${v.name};type=${v.type}"` ) From 168e2030409350463ae1ac504c6bbca59eafe9e0 Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Thu, 10 Aug 2017 18:27:03 -0700 Subject: [PATCH 2/2] Use hash for body in formData tests I couldn't find any instances of body being an array when testing formData with real specs... I think this was a mistake. --- test/core/curlify.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/core/curlify.js b/test/core/curlify.js index 82ee6a8a..8084bd6e 100644 --- a/test/core/curlify.js +++ b/test/core/curlify.js @@ -132,10 +132,10 @@ describe("curlify", function() { url: "http://example.com", method: "POST", headers: { "content-type": "multipart/form-data" }, - body: [ - ["id", "123"], - ["name", "Sahar"] - ] + body: { + id: "123", + name: "Sahar" + } } let curlified = curl(Im.fromJS(req)) @@ -152,10 +152,10 @@ describe("curlify", function() { url: "http://example.com", method: "POST", headers: { "content-type": "multipart/form-data" }, - body: [ - ["id", "123"], - ["file", file] - ] + body: { + id: "123", + file + } } let curlified = curl(Im.fromJS(req))