elderwand 0.1.66 → 0.1.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/utils/utils.js +3 -3
package/package.json
CHANGED
package/utils/utils.js
CHANGED
|
@@ -208,7 +208,7 @@ exports.doRequest = function(options, http, cb){
|
|
|
208
208
|
|
|
209
209
|
if(options.method != "GET"){
|
|
210
210
|
if(options.encodingType == "json"){
|
|
211
|
-
post_data = JSON.stringify(options.postData);
|
|
211
|
+
post_data = new Buffer(JSON.stringify(options.postData), "utf-8");
|
|
212
212
|
options.headers['Content-Length'] = post_data.length;
|
|
213
213
|
options.headers['Content-Type'] = "application/json";
|
|
214
214
|
|
|
@@ -222,7 +222,6 @@ exports.doRequest = function(options, http, cb){
|
|
|
222
222
|
options.headers['Content-Type'] = "application/x-www-form-urlencoded; charset=UTF-8";
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
//EWLog(options)
|
|
226
225
|
var req = http.request(options, function(res){
|
|
227
226
|
res.setEncoding(options.encoding);
|
|
228
227
|
var data = '';
|
|
@@ -241,7 +240,7 @@ exports.doRequest = function(options, http, cb){
|
|
|
241
240
|
if(options.encodingType == "binary"){
|
|
242
241
|
req.write(post_data,'binary');
|
|
243
242
|
}else{
|
|
244
|
-
req.write(post_data);
|
|
243
|
+
var ret = req.write(post_data, "utf-8");
|
|
245
244
|
}
|
|
246
245
|
}
|
|
247
246
|
|
|
@@ -260,6 +259,7 @@ exports.doRequest = function(options, http, cb){
|
|
|
260
259
|
};
|
|
261
260
|
|
|
262
261
|
|
|
262
|
+
|
|
263
263
|
exports.createHttpPostOptions = function(url, parameters, data){
|
|
264
264
|
var options = {
|
|
265
265
|
socksPort: 9050, // Tor
|