elderwand 0.1.66 → 0.1.67

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/utils/utils.js +3 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elderwand",
3
- "version": "0.1.66",
3
+ "version": "0.1.67",
4
4
  "description": "Mamtas Technology Internal Framework",
5
5
  "main": "./node_modules/.bin/nodemon index.js",
6
6
  "scripts": {
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 = Buffer.from(JSON.stringify(options.postData),'utf8');
212
212
  options.headers['Content-Length'] = post_data.length;
213
213
  options.headers['Content-Type'] = "application/json";
214
214
 
@@ -217,7 +217,7 @@ exports.doRequest = function(options, http, cb){
217
217
  options.headers['Content-Length'] = post_data.length;
218
218
 
219
219
  }else{
220
- post_data = querystring.stringify(options.postData);
220
+ post_data = Buffer.from(querystring.stringify(options.postData),'utf8');
221
221
  options.headers['Content-Length'] = post_data.length;
222
222
  options.headers['Content-Type'] = "application/x-www-form-urlencoded; charset=UTF-8";
223
223
  }
@@ -238,11 +238,7 @@ exports.doRequest = function(options, http, cb){
238
238
  });
239
239
  });
240
240
  if(options.method != "GET"){
241
- if(options.encodingType == "binary"){
242
- req.write(post_data,'binary');
243
- }else{
244
- req.write(post_data);
245
- }
241
+ req.write(post_data,'binary');
246
242
  }
247
243
 
248
244
  req.on('error', function(e) {