Skip to content

Commit dff52e9

Browse files
committed
fix(client): fixed timeout while sending request by HTTP/1.1
1 parent 313d4a7 commit dff52e9

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changes Logs
22

3+
## v1.0.5
4+
5+
- fix(client): fixed timeout while sending request by HTTP/1.1.
6+
37
## v1.0.4
48

59
- fix(client): HTTP/2 should use hostname in URL as host instead of `remoteHost`

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@litert/http-client",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"description": "A simple HTTP client based on LiteRT.",
55
"main": "lib/index.js",
66
"dependencies": {

src/lib/Internal/AbstractHttp1Client.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ export abstract class AbstractHttp1Client extends AbstractProtocolClient {
5555

5656
return new Promise((resolve, reject) => {
5757

58+
theReq.setTimeout(opts.timeout, () => theReq.destroy(new Error('timeout')));
59+
5860
theReq.on('response', (resp: $H1.IncomingMessage) => {
5961

6062
if (opts.timeout) {

0 commit comments

Comments
 (0)