From ca73055c74a8f9fa3b04599b7cf5460c27eb677d Mon Sep 17 00:00:00 2001 From: Sergey Trasko Date: Thu, 31 Oct 2019 10:16:36 +0200 Subject: [PATCH] Timeout for head/patch/delete operations --- src/httpTransport/client.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/httpTransport/client.ts b/src/httpTransport/client.ts index e3e09dd..939e43f 100644 --- a/src/httpTransport/client.ts +++ b/src/httpTransport/client.ts @@ -31,6 +31,7 @@ export class HttpTransportClient implements RestClient { const req = this.client.patch(uri, body); const res = await req .headers(_.get(opts, 'headers')) + .timeout(this.timeout) .query(_.get(opts, 'qs')) .asResponse(); @@ -111,6 +112,7 @@ export class HttpTransportClient implements RestClient { const req = this.client.head(uri); const res = await req .headers(_.get(opts, 'headers')) + .timeout(this.timeout) .query(_.get(opts, 'qs')) .asResponse(); @@ -128,6 +130,7 @@ export class HttpTransportClient implements RestClient { const req = this.client.delete(uri); const res = await req .headers(_.get(opts, 'headers')) + .timeout(this.timeout) .query(_.get(opts, 'qs')) .asResponse();