Skip to content

Commit 0bd1795

Browse files
committed
Dispose the internal client when using a custom handler
1 parent 23120fb commit 0bd1795

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/RestSharp/RestClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public RestClient(HttpClient httpClient, RestClientOptions? options = null, bool
9595
/// </summary>
9696
/// <param name="handler">Message handler instance to use for HttpClient</param>
9797
/// <param name="disposeHandler">Dispose the handler when disposing RestClient, true by default</param>
98-
public RestClient(HttpMessageHandler handler, bool disposeHandler = true) : this(new HttpClient(handler, disposeHandler)) { }
98+
public RestClient(HttpMessageHandler handler, bool disposeHandler = true) : this(new HttpClient(handler, disposeHandler), null, true) { }
9999

100100
void ConfigureHttpClient(HttpClient httpClient) {
101101
if (Options.Timeout > 0)

0 commit comments

Comments
 (0)