Skip to content

Commit

Permalink
fix for backslashes in data not encoding correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
krisnye committed Jul 19, 2013
1 parent 9f926de commit 983cfc2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/XMLHttpRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ exports.XMLHttpRequest = function() {
+ "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]);
Expand Down

0 comments on commit 983cfc2

Please sign in to comment.