Skip to content

Commit 983cfc2

Browse files
committed
fix for backslashes in data not encoding correctly
1 parent 9f926de commit 983cfc2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/XMLHttpRequest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ exports.XMLHttpRequest = function() {
477477
+ "fs.writeFileSync('" + contentFile + "', 'NODE-XMLHTTPREQUEST-ERROR:' + JSON.stringify(error), 'utf8');"
478478
+ "fs.unlinkSync('" + syncFile + "');"
479479
+ "});"
480-
+ (data ? "req.write('" + data.replace(/'/g, "\\'") + "');":"")
480+
+ (data ? "req.write('" + JSON.stringify(data).slice(1,-1).replace(/'/g, "\\'") + "');":"")
481481
+ "req.end();";
482482
// Start the other Node Process, executing this string
483483
var syncProc = spawn(process.argv[0], ["-e", execString]);

0 commit comments

Comments
 (0)