Update gqcq_wx.js

This commit is contained in:
leafTheFish
2022-10-23 13:21:59 +08:00
parent 83973c89da
commit 5eb762ff66

View File

@@ -65,7 +65,11 @@ class UserInfo {
} else {
urlObject.body = paramIn.body
}
urlObject.headers['Content-Length'] = urlObject.body ? Buffer.byteLength(urlObject.body, 'utf8') : 0
if($.isNode()) {
urlObject.headers['Content-Length'] = urlObject.body ? Buffer.byteLength(urlObject.body, 'utf8') : 0
} else {
urlObject.headers['Content-Length'] = urlObject.body ? urlObject.body.length : 0
}
}
if(paramIn.urlObjectParam) Object.assign(urlObject,paramIn.urlObjectParam);
if(paramIn.headerParam) Object.assign(urlObject.headers,paramIn.headerParam);