xjs-node 1.0.5 → 1.0.7
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/dist/index.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ export * from "./func/u";
|
|
|
2
2
|
export * from "./func/u-file";
|
|
3
3
|
export { HttpResolver, ClientMode } from "./prcs/http/http-resolver";
|
|
4
4
|
export { s_clientMode } from "./prcs/http/http-resolver-context";
|
|
5
|
-
export { IHttpClient } from "./prcs/http/i-http-client";
|
|
5
|
+
export { IHttpClient, HttpResponse } from "./prcs/http/i-http-client";
|
|
@@ -181,12 +181,13 @@ class HttpResolverContext {
|
|
|
181
181
|
req.destroy();
|
|
182
182
|
reject(new xjs_common_1.XjsErr(s_errCode, "The http request timeout, maybe server did not respond."));
|
|
183
183
|
});
|
|
184
|
-
if (payload)
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
184
|
+
if (payload instanceof stream_1.Stream)
|
|
185
|
+
payload.pipe(req, { end: true });
|
|
186
|
+
else {
|
|
187
|
+
if (payload)
|
|
188
188
|
req.write(payload);
|
|
189
|
-
|
|
189
|
+
req.end();
|
|
190
|
+
}
|
|
190
191
|
});
|
|
191
192
|
}
|
|
192
193
|
processResponse(resolve, reject, rc, host, res) {
|