Skip to content

Commit 13b392f

Browse files
fix: timeout
Set the HttpClient.Timeout to infinity. To timeout a request pass a CancellationToken that has a timeout.
1 parent f3e6e6c commit 13b392f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/IpfsClient.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,10 @@ HttpClient Api()
220220
handler.AutomaticDecompression = DecompressionMethods.GZip
221221
| DecompressionMethods.Deflate;
222222
}
223-
api = new HttpClient(handler);
223+
api = new HttpClient(handler)
224+
{
225+
Timeout = System.Threading.Timeout.InfiniteTimeSpan
226+
};
224227
api.DefaultRequestHeaders.Add("User-Agent", UserAgent);
225228
}
226229
}

0 commit comments

Comments
 (0)