xjs-node 3.0.0-alpha.6 → 3.0.0
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.
|
@@ -175,7 +175,7 @@ class HttpResolverContext {
|
|
|
175
175
|
}
|
|
176
176
|
else if (xjs_common_1.UType.isObject(payload)) {
|
|
177
177
|
p = JSON.stringify(payload);
|
|
178
|
-
params.headers["content-length"] = p
|
|
178
|
+
params.headers["content-length"] = Buffer.byteLength(p);
|
|
179
179
|
params.headers["content-type"] = "application/json";
|
|
180
180
|
}
|
|
181
181
|
return await this.reqHttps(u, params, p);
|
|
@@ -251,7 +251,7 @@ class HttpResolverContext {
|
|
|
251
251
|
if (sc !== 2) {
|
|
252
252
|
if (xjs_common_1.UType.isString(data) && data.trim())
|
|
253
253
|
this.warn(data);
|
|
254
|
-
reject(new xjs_common_1.XjsErr(s_errCode, `Https received
|
|
254
|
+
reject(new xjs_common_1.XjsErr(s_errCode, `Https received an error status ${res.statusCode}`));
|
|
255
255
|
}
|
|
256
256
|
else
|
|
257
257
|
resolve({ payload: data, headers: res.headers });
|