diff --git a/lib/XMLHttpRequest.js b/lib/XMLHttpRequest.js index 3c23907..447ec20 100644 --- a/lib/XMLHttpRequest.js +++ b/lib/XMLHttpRequest.js @@ -528,7 +528,7 @@ function XMLHttpRequest(opts) { + "fs.writeFileSync('" + contentFile + "', 'NODE-XMLHTTPREQUEST-ERROR:' + JSON.stringify(error), 'utf8');" + "fs.unlinkSync('" + syncFile + "');" + "});" - + (data ? "req.write('" + data.replace(/'/g, "\\'") + "');":"") + + (data ? "req.write('" + JSON.stringify(data).slice(1,-1).replace(/'/g, "\\'") + "');":"") + "req.end();"; // Start the other Node Process, executing this string var syncProc = spawn(process.argv[0], ["-e", execString]); diff --git a/package.json b/package.json index 235564a..eeea2f3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "xmlhttprequest-ssl", "description": "XMLHttpRequest for Node", - "version": "1.6.1", + "version": "1.6.2", "author": { "name": "Michael de Wit" },